Alan Lowbands
Aerospace
Can anyone help please.
I have this code that renumbers the 'Fix@ contraints to neaten up the tree.
Could anyone tell me what search perameters I need to use to get he code to renumber the
instance numbers of the parts in my tree.
Im probably missing something really simple.
many thanks
Alan
--------------------------------------------------------------------------
Language="VBSCRIPT"
Sub CATMain()
Dim productDocument1 'As Document
Set productDocument1 = CATIA.ActiveDocument
Dim selection1 'As Selection
Set selection1 = productDocument1.Selection
selection1.Search "CATAsmSearch.MfFixConstraint,in" 'HOW DO I SEACH FOR ALL THE PARTS'
'A loop to go thru each selected item and change it's name.
intNbSelected = selection1.Count2
If intNbSelected > 0 Then
For intIndex = 1 to intNbSelected
selection1.Item2(intIndex).Value.Name = "Fix." &intIndex
Next
End If
selection1.Clear
End Sub
I have this code that renumbers the 'Fix@ contraints to neaten up the tree.
Could anyone tell me what search perameters I need to use to get he code to renumber the
instance numbers of the parts in my tree.
Im probably missing something really simple.
many thanks
Alan
--------------------------------------------------------------------------
Language="VBSCRIPT"
Sub CATMain()
Dim productDocument1 'As Document
Set productDocument1 = CATIA.ActiveDocument
Dim selection1 'As Selection
Set selection1 = productDocument1.Selection
selection1.Search "CATAsmSearch.MfFixConstraint,in" 'HOW DO I SEACH FOR ALL THE PARTS'
'A loop to go thru each selected item and change it's name.
intNbSelected = selection1.Count2
If intNbSelected > 0 Then
For intIndex = 1 to intNbSelected
selection1.Item2(intIndex).Value.Name = "Fix." &intIndex
Next
End If
selection1.Clear
End Sub