Phadreus
Mechanical
- Feb 28, 2005
- 54
Greetings all,
I am running SW2005 and have a need to check for the existence of a custom property field (non configuration specific) in a macro. I am currently running the following VB Routine to create a custom field called "Manufacturer".
Sub main()
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
retval = Part.AddCustomInfo3(ConfigName, "Manufacturer", 30, "AAA")
End Sub
Before creating the custom field, I would first like to check for the existence of that field, and simply leave it alone if it exists. This way, I will not overwrite a custom property value if it allready exists. If it does not exist, then I would like to create it and populate it as shown in the above code.
Is it possible to check for the existence of an existing custom property field? What would the code look like to do this? Thanks in advance for any advice!
Mark Price
Automated Assembly & Test Systems
I am running SW2005 and have a need to check for the existence of a custom property field (non configuration specific) in a macro. I am currently running the following VB Routine to create a custom field called "Manufacturer".
Sub main()
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
retval = Part.AddCustomInfo3(ConfigName, "Manufacturer", 30, "AAA")
End Sub
Before creating the custom field, I would first like to check for the existence of that field, and simply leave it alone if it exists. This way, I will not overwrite a custom property value if it allready exists. If it does not exist, then I would like to create it and populate it as shown in the above code.
Is it possible to check for the existence of an existing custom property field? What would the code look like to do this? Thanks in advance for any advice!
Mark Price
Automated Assembly & Test Systems