Hello All,
I am new to the macro/API world and have been trying my best to understand some of this stuff. This forum has been very helpful in the past but this is my first post.
I found this discussion and modified it to my needs and it does work for the custom properties but not for all of the configuration specific properties. Our configs can be name a range of different things but are usually our part number. But basically we just need to delete the first two characters of the "Number" Custom and Config Specific Properties.
Any help would be greatly appreciated.
Thank you
Paul
Here is the current code
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swCustPropMgr As SldWorks.CustomPropertyManager
Dim Prop1 As String
Dim Prop2 As String
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swCustPropMgr = swModel.Extension.CustomPropertyManager("")
'Replace P1 with the actual property name
Prop1 = swModel.CustomInfo("")
Prop1 = Left(Prop1, 2)
Prop2 = swModel.CustomInfo("Number")
Prop2 = Right(Prop2, 4)
swModel.CustomInfo("Number") = Prop1 & Prop2
End Sub
SolidworksApi macros