×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Can I use an ACTConsole Snippet to get solid bodies in a geometry group?

Can I use an ACTConsole Snippet to get solid bodies in a geometry group?

Can I use an ACTConsole Snippet to get solid bodies in a geometry group?

(OP)
I normally group all the solid bodies representing bolts in a model together into a single geometry group. I would like to use a ACTConsole Snippet to get a list of all the bolts in that group. Is that possible? I am currently using this to get the groups in the model:

CODE -->

ExtAPI.DataModel.Project.Model.GetChildren(DataModelObjectCategory.TreeGroupingFolder,True) 

Looping through that, I can identify the group I want by getting the group with the "Geometry" as the parent and "bolt" in the name. However, I don't know how to get the children of the group. I think the documentation here might potentially be able to help me, but I don't really know what I'm looking at. Can anyone here point me in the direction I need to go?

RE: Can I use an ACTConsole Snippet to get solid bodies in a geometry group?

CODE --> Python

groups = ExtAPI.DataModel.Project.Model.Geometry.GetChildren(DataModelObjectCategory.TreeGroupingFolder,True) 

bolt_group = groups[0]

if "Bolt" in bolt_group.Name:
	bolts = bolt_group.Children 

RE: Can I use an ACTConsole Snippet to get solid bodies in a geometry group?

CODE -->

groups = ExtAPI.DataModel.Project.Model.Geometry.GetChildren(DataModelObjectCategory.TreeGroupingFolder,True) 

bolt_groups = [group for group in groups if "Bolt" in group.Name]
bolt_group = bolt_groups[0]

bolt_parts = bolt_group.Children

bolt_bodies = [part.Children[0] for part in bolt_parts] 

RE: Can I use an ACTConsole Snippet to get solid bodies in a geometry group?

(OP)
Perfect. Thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Research Report - What’s the State of Nonlinear Simulation?
Simulation is an increasingly valuable tool across the product design workflow, but not all simulations are equal. We set out to determine how engineers and product designers make use of specialized analyses, how they incorporate nonlinear simulation into their work and how they rate the available software. Download Now
White Paper – Data Security and Know-How Protection
Our data is constantly exposed to the danger of being intercepted or stolen as it wends its way over global data networks. Data security measures and measures for protecting intellectual property should not, however, first be implemented when data is exchanged – companies must lay the foundation for these measures within their own organization. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close