Open an Inventor file using C#

Top  Previous  Next

You can use Open or OpenWithOptions. Here's how to do it with OpenWithOptions:

 

 

   NameValueMap Options = m_Inventor.TransientObjects.CreateNameValueMap () ;

   // Some example options....

   Options.Add("SkipAllUnresolvedFiles", true);

   Options.Add("DesignViewRepresentation", "View1");

   Options.Add("DeferUpdates", true);

 

   AssemblyDocument IamDoc = (AssemblyDocument)m_Inventor.Documents.OpenWithOptions(sFullDocName,Options,true);

 

 

The last true means Open Visible.

 

The DeferUpdates in interesting. If you turn defer updates on, Inventor blocks all kinds of editability, to the in-memory data.  But the file itself stays as is, so that is what I use for read-only processing, where I only want to read from the file, and not modify it.

 

 

 

Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)