This macro to retrieve the filename, to be adapted as needed
Ace Object
As ModelDoc2
As SldWorks.Configuration
As CustomPropertyManager
As Long
As String
As String
As String
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc'We get the file
name myValue1 = Left(myValue0, 8) 'first 8 characters of the file name
Set config = swModel.GetActiveConfiguration
Set cusPropMgr = config. CustomPropertyManager
lRetVal = cusPropMgr.Add3("filname", swCustomInfoType_e.swCustomInfoText, myValue1, swCustomPropertyAddOption_e.swCustomPropertyDeleteAndAdd)
End Sub
I don't understand where to put the solidworks settings in the part model, plan and asm.
I think you have to create all these parameters before in the different models (part, Asm Drw) but WHERE and How? That is the question! I watched a video but the person had probably created everything before so I'm not further ahead. (despite the indications of @Yannick ;-) )
I must be a little dumb because I can't find how to do it in the online help.
I just got back on the subject but something escapes me in SW's logic
In the MEP and therefore in the background of the plan I have access to certain variables. But for the ones that are missing as "matter" "Mass": if I want to create missing variables I can't, even in Administrator mode. I must be doing it wrong!
On the other hand I read this"
you will have to add a custom property in an example part or through the property form for example or by filling in a property in File => Properties. Then perform:
→ Create a drawing with the basemap to be modified
Does this mean that I can only create the properties in a model part, so an SDLPART.dot, and also that if my SLDPART.dot doesn't have all the properties I can imagine, I can't create it, nor use it in the basemap. I don't understand why the property form doesn't independently create all the properties you want and that ASM, PRT and DRW use on simple creation in an area of the MEP (here it's the MEP that interests me)