cubygt
Aerospace
- Feb 10, 2017
- 10
Please I need help... I have created the following macros; however, they only work if the product or part is opened up in a separate window. I would like to run a single macro that would these and add the defined properties to every product and part in a assembly.
script for product properties:
Sub CATMain()
Set productdoc = CATIA.ActiveDocument
Set product1 = productdoc.Product
Set parameters1 = product1.UserRefProperties
Set strParam1 = parameters1.CreateString("DRAWING NUMBER", "")
strParam1.ValuateFromString product1.Name & "_SHT_1"
End Sub
script for part properties:
Sub CATMain()
Set productdoc = CATIA.ActiveDocument
Set product1 = productdoc.Product
Set partdocument1 = CATIA.ActiveDocument
Set part1 = partdocument1.Part
Set bodies1 = part1.bodies
Set bodyn = bodies1.Item(1)
Set parameters1 = product1.UserRefProperties
Set parameters2 = product1.UserRefProperties
Set strParam1 = parameters1.CreateString("DRAWING NUMBER", "")
Set strParam2 = parameters1.CreateString("MATERIAL/SPECIFICATION", "")
strParam1.ValuateFromString product1.Name & "_SHT_1"
strParam2.ValuateFromString bodyn.Name
End Sub
Thanks...
script for product properties:
Sub CATMain()
Set productdoc = CATIA.ActiveDocument
Set product1 = productdoc.Product
Set parameters1 = product1.UserRefProperties
Set strParam1 = parameters1.CreateString("DRAWING NUMBER", "")
strParam1.ValuateFromString product1.Name & "_SHT_1"
End Sub
script for part properties:
Sub CATMain()
Set productdoc = CATIA.ActiveDocument
Set product1 = productdoc.Product
Set partdocument1 = CATIA.ActiveDocument
Set part1 = partdocument1.Part
Set bodies1 = part1.bodies
Set bodyn = bodies1.Item(1)
Set parameters1 = product1.UserRefProperties
Set parameters2 = product1.UserRefProperties
Set strParam1 = parameters1.CreateString("DRAWING NUMBER", "")
Set strParam2 = parameters1.CreateString("MATERIAL/SPECIFICATION", "")
strParam1.ValuateFromString product1.Name & "_SHT_1"
strParam2.ValuateFromString bodyn.Name
End Sub
Thanks...