mayrou
Electrical
- Jan 8, 2014
- 55
Hi everybody
I want to copy a shape (a point, a line...) from one part to another, with a PastSpecial as a result!
is it possible?
I tried to do somethin like that! but i failed
it generates nothing
I want to copy a shape (a point, a line...) from one part to another, with a PastSpecial as a result!
is it possible?
I tried to do somethin like that! but i failed
Code:
Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = productDocument1.Selection
selection1.Clear
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As Document
Set partDocument1 = documents1.Item("part1.CATPart")
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies
Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("Construction")
Dim hybridShapes1 As HybridShapes
Set hybridShapes1 = hybridBody1.HybridShapes
Dim hybridShapePointCenter1 As HybridShape
Set hybridShapePointCenter1 = hybridShapes1.Item("Point.1")
selection1.Add hybridShapePointCenter1
selection1.Copy
selection1.Clear
''''''''''''''
Dim partDocument2 As Document
Set partDocument2 = documents1.Item("part2.CATPart")
Dim part2 As Part
Set part2 = partDocument2.Part
Dim hybridBodies2 As HybridBodies
Set hybridBodies2 = part2.HybridBodies
Dim hybridBody2 As HybridBody
Set hybridBody2 = hybridBodies2.Item("Set géométrique.1")
Set selection1 = productDocument1.Selection
selection1.Add hybridBody2
selection1.PasteSpecial As a result
it generates nothing