For the moment except with a macro, I don't see how to add this info in the properties. However, if you want the macro:
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim config As SldWorks.Configuration
Dim cusPropMgr As SldWorks.CustomPropertyManager
Dim custPropType As Long
Dim FieldType As Integer
Dim customProp As CustomPropertyManager
Dim PathPlan As String
Sub main()
FieldType = 30
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set config = swModel.GetActiveConfiguration
Dim swCustProp As CustomPropertyManager
Dim swModelDocExt As ModelDocExtension
Dim bool As Boolean
Set swModelDocExt = swModel.Extension
Set swCustProp = swModelDocExt.CustomPropertyManager("")
PathPlan = swModel.GetPathName
bool = swCustProp.Add3("Chemin Fichier", FieldType, PathPlan, swCustomPropertyAddOption_e.swCustomPropertyDeleteAndAdd)
End Sub
Alternatively, to add this info to a note in a drawing, you can link a property to a note. (See pj)
Why not use the "SmartProperties" tool from myCADtools? This tool allows, among other things, to concatenate property values (a feature that the SW property editor does not allow).
It is precisely because quotation marks do not work that we should put " Instead, and this is true for all text that includes quotation marks in the attribute value in XML files, which is the case with the .prtprp file, quotation marks are used to surround attributes.
Thank you for this information, but I'm surprised, in the listing of properties I have the impression that you can enter the names of properties either in English or in French...?
I have one last small problem, I would like to display the name of the file with its ".sldprt" extension, but I can't find the right syntax....?
I haven't tested for English or French, for my part I haven't used the property palettes for a long time but at the time it was systematically in English.
For the addition of the extension, I couldn't find a corresponding property but it is possible by creating a text property that contains the desired value according to the loaded property palette (.prtprp or .asmprp file) and then concatenating it with the SW properties as in the example below:
Opening the palette and before clicking on "Apply":
The calculation is not made.
After clicking on "Apply":
The calculation was done well.
Test done by opening the part in SW and also directly by editing the part in the assembly.
Did you put Mode="Text" at the end of the line that defines the "Extension" property?
To the question " what is another solution for filling in the § attributes? ", it's by a homemade program in which I manage SW properties and many other things.