Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if selected entity is part of a surface body or a solid body

Status
Not open for further replies.

men8th

Nuclear
Jul 1, 2016
19
Hi,

I am trying to write a macro to determine if an entity (face, vertex, surface etc.) which a user has selected is part of a solid body (ie an item which is a member of the solid bodies folder at the top of the feature tree) or if it is part of a surface (ie an item which is a member of the surface bodies folder at the top of the design tree).

Can anybody point me in the right direction? Ideally there would be a "GetParentBodyType" method, or similar, which can be run on the selected entity.

I have this so far:

Set swRefFeature = swSelMgr.GetSelectedObject6(1, -1) 'Get a pointer to the selected geometry

What I'd like is

<pseudo code>

If swRefFeatre.GetParentBodyType <> swSolidBody Then
'do some stuff​
End If

<end of pseudo code
 
Replies continue below

Recommended for you

You can't get all the way from entity to body type in one step. Be patient. Slow down and smell the roses. From your entity, use GetBody to get the body. Then use GetType on the body to get the body type.

I have no idea where they came up with these confusing function names.

-handleman, CSWP (The new, easy test)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor