Hi,
I was trying to apply this solution to a section view that was being placed on an Inventor Drawing using the API. The parts in the model are coming from the content center but need to be sectioned. It seems this method might be the only way to allow them to section, however when I call the command: _inventorApplication.CommandManager.ControlDefinitions[“AllowSectionParticipation”].Execute() nothing appears to happen.
Stepping through the add-in, the application calls the command without issue or throwing any exceptions. After the program completes, the correct node is expanded and selected (highlighted), but the component remains 'un'-sectioned. I can right click the node that is selected and select 'Section' under participation and the section works then.
The only thing I can think is maybe the application isn't 'Ready' and that the views are not fully calculated, but nothing I try seems to change anything.
Any thoughts on how i could get this to work would be most appreciated?
Additional information:
- I've also tried .Execute2(true)
- This is in a full custom add-in we are creating that builds the assembly from content center and creates a drawing of that assembly so I don't have any small sample code, but I could provide the entirety of the logic surrounding this operation (though its entirely based on the information linked)
- I am setting the section behavior prior to navigating the browser and performing the execute operation
_sectionView.StandardPartsSectionBehavior = StandardPartsSectionBehaviorEnum.kObeyBrowserSettingsSectionStandardParts;
- I am only changing _inventorApplication.SilentOperation = true; no other inventor behavior modifications (screen updating, userinteraction, etc)
- I've tried running AssemblyDrawingDocument.Update2(true); before calling the execute command.
- I'm running this from Visual Studio in C#. I just noticed that I am using the ControlDefinitions[“..."] syntax, which may not work in this application
Best of Luck
---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.