AeroTD
Aerospace
- Feb 25, 2022
- 4
I know the following is NOT the most efficient method but I'm having a hard time finalizing the code even though I'm sure it's simple enough. I would appreciate 1. some feedback to eliminate the specific text (eg: Fix., Coincidence., Offset.) with a variable 2. I've had success calling the renumbering code as a sub routine but pulled it out for testing.
Option Explicit
Sub CATMain()
Dim osel As Selection
Dim i As Integer
Set osel = CATIA.ActiveDocument.Selection
osel.Search "(Name='Fix.*' & CATAsmSearch.MfConstraint),in"
For i = 1 To osel.Count
osel.Item(i).Value.Name = "Fix." & i
Next 'i
osel.Clear
osel.Search "(Name='Coincidence.*' & CATAsmSearch.MfConstraint),in"
For i = 1 To osel.Count
osel.Item(i).Value.Name = "Coincidence." & i
Next 'i
osel.Clear
osel.Search "(Name='Offset.*' & CATAsmSearch.MfConstraint),in"
For i = 1 To osel.Count
osel.Item(i).Value.Name = "Offset." & i
Next 'i
osel.Clear
End Sub
Thank you!
Option Explicit
Sub CATMain()
Dim osel As Selection
Dim i As Integer
Set osel = CATIA.ActiveDocument.Selection
osel.Search "(Name='Fix.*' & CATAsmSearch.MfConstraint),in"
For i = 1 To osel.Count
osel.Item(i).Value.Name = "Fix." & i
Next 'i
osel.Clear
osel.Search "(Name='Coincidence.*' & CATAsmSearch.MfConstraint),in"
For i = 1 To osel.Count
osel.Item(i).Value.Name = "Coincidence." & i
Next 'i
osel.Clear
osel.Search "(Name='Offset.*' & CATAsmSearch.MfConstraint),in"
For i = 1 To osel.Count
osel.Item(i).Value.Name = "Offset." & i
Next 'i
osel.Clear
End Sub
Thank you!