Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to select item within a selection 1

Status
Not open for further replies.

masswts

Aerospace
Oct 4, 2012
3
Hi,

New to forum and vba coding,

I am trying to move through a search result collection, select each one then perform measure inertia.

Have managed to get search results, but stuck on how to select each in turn to so that I can analyse

Sub CATMain()

Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
Dim part2 As Object
Dim selection1 As Selection
Set selection1 = productDocument1.Selection
Set selection2 = productDocument1.Selection
selection1.Search "Name=partbody,all"
Set selection1 = productDocument1.Selection
node_amount = selection1.Count
For node_count = 1 To node_amount

' selection1.Item(node_count)
' how to move through each of the found items in the search to enable measure inertia command????
CATIA.StartCommand ("Measure Inertia")

Next node_count
End Sub

Any help appreciated.

 
Replies continue below

Recommended for you

Thanks Fernando,
But when I click the link, there is no file.

Regards
 
Thanks Fernando,

Got the file, looks like some reading required !!!

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor