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!

Catia v5 vba - macro recorder - paste as result not recorded 1

Status
Not open for further replies.

Jean-Marc Flamand

New member
Jun 11, 2019
2
CA
I did record a macro that copy a geometrical set from a catpart and paste "as result" into another catpart but the paste as result instruction did not record the instruction. Need help to complete the code below.

Dim documents1 As Documents
Set documents1 = CATIA.Documents

Dim partDocument1 As PartDocument
Set partDocument1 = documents1.Item("cyl1.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("toto")

selection1.Add hybridBody1

selection1.Copy

Dim partDocument2 As PartDocument
Set partDocument2 = documents1.Item("Cyl2.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("toto")

part2.UpdateObject hybridBody2

part2.Update

End Sub
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top