Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Section Participation

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
scottmoyse
1162 Views, 6 Replies

Section Participation

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.


EESignature


Design & Manufacturing Technical Services Manager at Cadpro New Zealand

Co-founder of the Grumpy Sloth full aluminium billet mechanical keyboard project

6 REPLIES 6
Message 2 of 7
xiaodong_liang
in reply to: scottmoyse

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:

http://adndevblog.typepad.com/manufacturing/2012/09/parse-browsernodes-for-a-specified-node-and-perf...

 

Hope it helps.

Message 3 of 7
gavbath
in reply to: scottmoyse

Download the app called D&M Section Hatch Updates from the Inventor App Exchange store and that should provide you with what you need! Smiley Very Happy

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

Message 4 of 7
NSBowser
in reply to: xiaodong_liang

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.
Message 5 of 7
NSBowser
in reply to: xiaodong_liang

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...

 

 


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
Message 6 of 7
NSBowser
in reply to: NSBowser

I discovered a tidbit here:

 

https://forums.autodesk.com/t5/inventor-customization/command-manager-and-ilogic-automation-not-work...

 

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

 


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
Message 7 of 7
RodrigoEiras
in reply to: NSBowser

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: 

 

Aantekening 2020-11-06 154505.jpg

 

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!

 

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report