- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I have an Inventor assembly model, that is configurable with user parameters.
Whenever parameters are changed, an iLogic rule ("Rule0") is called, that will update the model according to the actual parameters. A main thing in Rule0 is to loop through all component occurrences and set the Suppressed state of each according to the actual parameters.
It goes like this:
It works fine.
Now, I have some external code, that does the following using API calls:
* Opens the assembly file described above
* Loads parameters from an external XML file and applies it to the model
* Explicitly calls "Rule0" to update the model
* Saves the model with a new name ("doc.SaveAs")
This also works fine.
Now comes the issue: If I change the external code to open the model in "invisible mode", like this:
Dim model As Inventor.AssemblyDocument = ThisApplication.Documents.Open(pathToSourceModel, False)
...then the logic breaks. I have debugged it down to the issue, that in Rule0 of the model, oDef.Occurrences is empty. This has been confirmed by the logger trace
Logger.Trace("#Components: " & oDef.Occurrences.Count)
...showing that there are no components.
As a consequence, Rule0 does not update the model correctly.
Is this expected behavior, that no component occurrences are present, when the document is opened in invisible mode? Is there any explicit call, that can make them appear?
Solved! Go to Solution.