akhtar07
Mechanical
- Mar 8, 2015
- 59
Hey guys,
I have a macro that generates part properties automatically. What i would like to do is to put a check in, so the macro stop regenerating the properties if they already exists.
Image is attached for reference.
Script is below:
Language="VBSCRIPT"
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
Set parameters1 = product1.UserRefProperties
Set strParam1 = parameters1.CreateString("Project", "")
strParam1.ValuateFromString ""
Set parameters2 = product1.UserRefProperties
Set strParam2 = parameters1.CreateString("Title", "")
strParam2.ValuateFromString ""
Set parameters3 = product1.UserRefProperties
Set strParam3 = parameters1.CreateString("DrawingNumber", "")
strParam3.ValuateFromString ""
so the macro generates Project, Title and DrawingNumber... If the macro is run again, it shouldn't generate them again.
Please help guys, thanks.
Warm regards,
Akhtar Aziz
I have a macro that generates part properties automatically. What i would like to do is to put a check in, so the macro stop regenerating the properties if they already exists.
Image is attached for reference.
Script is below:
Language="VBSCRIPT"
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
Set parameters1 = product1.UserRefProperties
Set strParam1 = parameters1.CreateString("Project", "")
strParam1.ValuateFromString ""
Set parameters2 = product1.UserRefProperties
Set strParam2 = parameters1.CreateString("Title", "")
strParam2.ValuateFromString ""
Set parameters3 = product1.UserRefProperties
Set strParam3 = parameters1.CreateString("DrawingNumber", "")
strParam3.ValuateFromString ""
so the macro generates Project, Title and DrawingNumber... If the macro is run again, it shouldn't generate them again.
Please help guys, thanks.
Warm regards,
Akhtar Aziz