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.
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.