Alan Lowbands
Aerospace
Hi Gents,
I was looking at this bit of code before Christmas and couldn't get it working.
I have found the 'PasteSpecial("CATPrtResult")' command that seems to paste the axis systems into the last selected part.
What it wont do is copy all the axis systems from any multiple instance parts.
ie.
top product
one.catpart
two.catpat
two.catpar
three.catpart
three.catpart
three.catpart
copied axis part.catpart
The last part has a copy of the last instance only.
Can anyone tell me what I'm missing please. (code below)
regards
Alan
---------------------------------------------------------------------------
Dim sSel 'As Selection
Set sSel = CATIA.ActiveDocument.Selection
sSel.Search "CATGmoSearch.AxisSystem,sel"
icount = sSel.Count
MsgBox icount
Dim i 'As Integer
For i = 1 To sSel.Count
sSel.Item(i).Value.Name = sSel.Item(i).Value.Name&i
sSel.Copy()
sSel.PasteSpecial("CATPrtResult")
sSel.Clear
Next
End sub
-------------------------------------------------------------
Sub CATMain()
Dim sSel 'As Selection
Set sSel = CATIA.ActiveDocument.Selection
sSel.Search "CATGmoSearch.AxisSystem,sel"
icount = sSel.Count
MsgBox icount
Dim i 'As Integer
For i = 1 To sSel.Count
sSel.Item(i).Value.Name = sSel.Item(i).Value.Name&i
sSel.Copy()
sSel.PasteSpecial("CATPrtResult")
sSel.Clear
Next
End sub
'----------------------
I was looking at this bit of code before Christmas and couldn't get it working.
I have found the 'PasteSpecial("CATPrtResult")' command that seems to paste the axis systems into the last selected part.
What it wont do is copy all the axis systems from any multiple instance parts.
ie.
top product
one.catpart
two.catpat
two.catpar
three.catpart
three.catpart
three.catpart
copied axis part.catpart
The last part has a copy of the last instance only.
Can anyone tell me what I'm missing please. (code below)
regards
Alan
---------------------------------------------------------------------------
Dim sSel 'As Selection
Set sSel = CATIA.ActiveDocument.Selection
sSel.Search "CATGmoSearch.AxisSystem,sel"
icount = sSel.Count
MsgBox icount
Dim i 'As Integer
For i = 1 To sSel.Count
sSel.Item(i).Value.Name = sSel.Item(i).Value.Name&i
sSel.Copy()
sSel.PasteSpecial("CATPrtResult")
sSel.Clear
Next
End sub
-------------------------------------------------------------
Sub CATMain()
Dim sSel 'As Selection
Set sSel = CATIA.ActiveDocument.Selection
sSel.Search "CATGmoSearch.AxisSystem,sel"
icount = sSel.Count
MsgBox icount
Dim i 'As Integer
For i = 1 To sSel.Count
sSel.Item(i).Value.Name = sSel.Item(i).Value.Name&i
sSel.Copy()
sSel.PasteSpecial("CATPrtResult")
sSel.Clear
Next
End sub
'----------------------