Iqtar
Industrial
- Feb 3, 2021
- 5
hello
I'm looking for a script for copy/Paste Part bodys from a positioned Part in a Product context
the one below copies and Pasts the Part body in the new part without the postion of the source in the Product
(The source part is designed in the origine 0,0,0 and positioned in the product)
Script :
oActiveDoc.Activate: oActiveDoc.Selection.Clear
For Each oBody In oDocToTreat.oRefProd.Parent.Part.Bodies
oActiveDoc.Activate: oActiveDoc.Selection.Clear
If oBody.InBooleanOperation = False Then
oActiveDoc.Selection.Add oBody
oActiveDoc.Selection.Copy: oActiveDoc.Selection.Clear
oNewPartDoc.Activate
oNewPartDoc.Product.PartNumber = oDocToTreat.oRefProd.PartNumber
oNewPartDoc.Selection.Clear
oNewPartDoc.Selection.Add oNewPartDoc.Part
On Error Resume Next
oNewPartDoc.Selection.PasteSpecial "CATPrtResultWithOutLink"
On Error GoTo 0
oNewPartDoc.Selection.Clear
oDocToTreat.oRefProd.Parent.Selection.Clear
End If
Next oBody
oNewPartDoc.Selection.Clear
oDocToTreat.oRefProd.Parent.Selection.Clear
Thanks
I'm looking for a script for copy/Paste Part bodys from a positioned Part in a Product context
the one below copies and Pasts the Part body in the new part without the postion of the source in the Product
(The source part is designed in the origine 0,0,0 and positioned in the product)
Script :
oActiveDoc.Activate: oActiveDoc.Selection.Clear
For Each oBody In oDocToTreat.oRefProd.Parent.Part.Bodies
oActiveDoc.Activate: oActiveDoc.Selection.Clear
If oBody.InBooleanOperation = False Then
oActiveDoc.Selection.Add oBody
oActiveDoc.Selection.Copy: oActiveDoc.Selection.Clear
oNewPartDoc.Activate
oNewPartDoc.Product.PartNumber = oDocToTreat.oRefProd.PartNumber
oNewPartDoc.Selection.Clear
oNewPartDoc.Selection.Add oNewPartDoc.Part
On Error Resume Next
oNewPartDoc.Selection.PasteSpecial "CATPrtResultWithOutLink"
On Error GoTo 0
oNewPartDoc.Selection.Clear
oDocToTreat.oRefProd.Parent.Selection.Clear
End If
Next oBody
oNewPartDoc.Selection.Clear
oDocToTreat.oRefProd.Parent.Selection.Clear
Thanks