Multi-body part, solid body visibility: suppressed features affect rule operatio

Multi-body part, solid body visibility: suppressed features affect rule operatio

rob
Advocate Advocate
891 Views
2 Replies
Message 1 of 3

Multi-body part, solid body visibility: suppressed features affect rule operatio

rob
Advocate
Advocate

I am using an iLogic rule to activate and deactivate features dependent on user form selections.

 

The resultant multi-body part is exported to a parasolid for CNC programming; for any given configuration, some solid bodies have all features supressed, and are thus 'empty'/redundant.  Manually hiding these bodies prevents their export.

 

I want to hide these bodies with an Ilogic rule; there is a rule which works well for bodies containing at least one active feature; however when all features in the body are suppressed, the rule throws errors.  Yet I can hide these same bodies manually.

 

Can someone explain why this is, or how to get around it?  Thanks!

IV Pro 2020.2
0 Likes
Accepted solutions (1)
892 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

As far a i know there are 3 ways to get the surface body. by looping over:

  • PartDocumen.ComponentDefinition.SurfaceBodies
  • PartDocumen.ComponentDefinition.Features.item(x).SurfaceBodies
  • browsernodes.

it looks like the body stops to exist  when there are none features for it. The browser node is visable but the underling body gives an exception when it is used.

i dont know any more options to get the body and hide it..... therefore i cant help you maby some one else knows. below you will find the iLogic code that i used to test the different options maby it helps someone. 

 

Dim doc As PartDocument = ThisApplication.ActiveDocument

'tryed looping over all bodies. Only bodies with an has an unsuppresed feature are in the list
For Each body As SurfaceBody In doc.ComponentDefinition.SurfaceBodies
    MsgBox("Test 1: " & body.Name)
Next

'tryed looping over all features and have a look at the bodies that consume that feature. 
'suppresed Features are found but there is only a body if the body has an unsuppresed feature
For Each Feature As PartFeature In doc.ComponentDefinition.Features
    If (Feature.SurfaceBodies IsNot Nothing) Then
        MsgBox("Test 2: " & Feature.Name & " + " & Feature.SurfaceBodies.Item(1).Name)
    Else
        MsgBox("Test 2: " & Feature.Name & " does not belong to any SurfaceBody")
    End If
Next

'tryed looking up the bodie by the browser. 
'i can find all nodes for bodies but can only get the nativeobject of the node (the body) 
'If the Then body has an unsuppresed feature
For Each node As BrowserNode In doc.BrowserPanes.Item("Model").TopNode.BrowserNodes
    If (node.BrowserNodeDefinition.Label.Contains("Solid Bodies")) Then
        For Each bodyNode As BrowserNode In node.BrowserNodes
            MsgBox("Test 3: " & bodyNode.BrowserNodeDefinition.Label)
            Dim body As SurfaceBody = bodyNode.NativeObject
        Next
    End If
Next

Jelte de Jong
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


Blog: hjalte.nl - github.com

Message 3 of 3

rob
Advocate
Advocate

Thanks for your reply. 

 

I've double-checked my assumption that an 'empty' (no active features) solid body browser node description gets exported...it doesn't.

 

So the main motive for me wanting to 'hide' the browser node description is already fulfilled; that leaves only the wish for a visual cue in the browser tree that the solid body is 'empty' without having to expand it.

 

I'm going to mark your reply as 'solving' the query, thanks for your comments!

IV Pro 2020.2
0 Likes