I am not the best programmer so I'm hoping this is a simple solution for those who are more experienced, but I am trying to write a macro that will add a custom property to a drawing.
When I run the below code, I get the error "Object doesn't support this property or method"... and it highlights the line
Set swCustPropMgr = Part.CustomPropertyManager
It seems it has a problem with the CustomPropertyManager?
Here is my code below... just wondering if anyone could help me?
------------------------------------------------------------------------
Private Sub CommandButton1_Click()
Dim swCustPropMgr As SldWorks.CustomPropertyManager
Dim bRet As String
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set swCustPropMgr = Part.CustomPropertyManager
bRet = swCustPropMgr.Add2("Description", swCustomInfoText, "blah blah")
End Sub
------------------------------------------------------------------------
Thanks in advance,
Brett
SolidworksApi macros