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!

Part selection search

Status
Not open for further replies.

Alan Lowbands

Aerospace
May 17, 2017
274
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top