Is Section Participation of a component accesible via the API?
It can be controlled locally with respect to a view in a drawing, or via document settings for the file itself ( so it would always be excluded). I'm hoping it's available in either of those two areas of the API.
So far we've not been able to find it in the API help. Can someone clarify please?
Scott Moyse
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Design & Manufacturing Technical Services Manager at Cadpro New Zealand
Co-founder of the Grumpy Sloth full aluminium billet mechanical keyboard project
Solved! Go to Solution.
Solved by gavbath. Go to Solution.
Solved by xiaodong_liang. Go to Solution.
Hi,
So far, I do not see a direct way. While it could always be a workaround to execute the corresponding command by API. i.e. assume you have found the browser node of the component you do not want to “section participant”., select it and execute
ThisApplication.CommandManager. ControlDefinitions(“AllowNoneParticipation”).Execute()
or
ThisApplication.CommandManager. ControlDefinitions(“AllowSectionParticipation”).Execute()
or
ThisApplication.CommandManager. ControlDefinitions(“AllowSliceParticipation”).Execute()
You will need to create a code to find the node. Here is one blog which may give a clue:
Hope it helps.
Download the app called D&M Section Hatch Updates from the Inventor App Exchange store and that should provide you with what you need!
Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube
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”].Ex
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:
_sectionView.StandardPartsSectionBehavior = StandardPartsSectionBehaviorEnum.kObeyBrowserSettingsSectionStandardParts;
A quick followup:
To ensure that the problem wasn't with the ControlDefinitions[...] syntax, i replaced the logic with the following:
private void setSectionParticipation(BrowserNode node) { node.Expanded = true; node.DoSelect(); executeCommand("AllowSectionParticipation"); } private void executeCommand(string controlName) { ControlDefinitions controlDefs = _inventorApplication.CommandManager.ControlDefinitions; foreach (ControlDefinition controlDef in controlDefs) { if (controlDef.InternalName == controlName) { controlDef.Execute2(true); return; } } }
This ensured (at least in my mind) that i was actually getting the correct control
It, however, had no affect. the result was the same...
I discovered a tidbit here:
which made me try setting the userInteractionDisabled setting to false
_inventorApplication.UserInterfaceManager.UserInteractionDisabled = false;
Upon doing so the operation succeeds. I assume even though I never set it to true, the API calls are somehow triggering a user interaction suppression which nullifies the 'Execute' command since it sees it as some sort of user interaction
Good afternoon,
I am having a similar problem with an iLogic rule and I have tried to apply the tips mentioned in this thread. But I may have a different problem I think.
I am trying to change the section participation of a subassembly in my assembly. If I run the rule nothing happens although I see that the elements are selected (the right BrowserNodes are found).
If I manually look at the section participation of the subassembly I see this:
If I manually change the section participation to "Section" (for example) then I run the rule and it works properly.
Once I find the right BrowserNode I am using the following subroutine:
Sub SetNodeNoSectionParticipation (oBrowserNode As BrowserNode)
ThisApplication.UserInterfaceManager.UserInteractionDisabled = False
oBrowserNode.DoSelect
ThisApplication.CommandManager.ControlDefinitions.Item("AllowNoneParticipation").Execute()
End Sub
Can anybody help me to find a solution to make the rule work without manual intervention? (It looks like it may be related to the fact that when I select the subaseembly some parts are participating on the section and some not.)
Thanks in advance!