how to write a solidworks macro to pick the first 5 characters of the file name and assign it to a custom property
Below code would read 5 chars from the model title, where swModel is of type IModelDoc2 or any derived (i.e. IPartDoc, IAssemblyDoc, IDrawingDoc).
Dim val As String
val = Left(swModel.GetTitle(), 5)
Read the following article on how to assign the values to custom properties: SOLIDWORKS Custom Properties Automation
Retrieving data ...