What is going on? Occurrence.SurfaceBodies Count is zero for parts with no solid parts

wfajber
Contributor
Contributor

What is going on? Occurrence.SurfaceBodies Count is zero for parts with no solid parts

wfajber
Contributor
Contributor
Dim occ As Inventor.ComponentOccurrence
occ = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kAssemblyOccurrenceFilter, "pick an occurrence") 
Logger.Info("For part " & occ.Name & " The number of surface bodies is " & occ.SurfaceBodies.Count)




I was debugging a rule, and I became confused about surfacebodies.   I was adding a part that is nothing but surface.  I was repurposing a rule that got an edge from a occurrence, which worked great.  I switched to a part that does not have any solids, and it failed.

 

Here are two parts. They are identical except in one of them I extruded the profile as a surface instead of a solid.

 

When I select the occurrence of the solid part, the number of SurfaceBodies= 1. 

But when I select the occurrence of the surface part, the number of SurfaceBodies= 0.

wfajber_2-1712884505283.png

 

But I can see it. In the model browser, I can see a surface in the SurfaceBody browser.  

 

wfajber_0-1712884238515.png

 

 

Clearly there is a subtlety around how a how an occurrence displays the surface. Can anyone explain this? 

 

  

0 Likes
Reply
223 Views
2 Replies
Replies (2)

vpeuvion
Advocate
Advocate
0 Likes

Michael.Navara
Advisor
Advisor

I don't know how it is designed, but you can obtain WorkSurfaces from occ.Definition.WorkSurfaces

 

Dim occ As Inventor.ComponentOccurrence
occ = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kAssemblyOccurrenceFilter, "pick an occurrence") 
Logger.Info("For part " & occ.Name & " The number of surface bodies is " & occ.SurfaceBodies.Count)
Logger.Info("For part " & occ.Name & " The number of work surfaces is " & occ.Definition.WorkSurfaces.Count)

 

Note: Both models are empty ☹️