I am creating a macro to do autofill properties and save the drawing.
I want to save the drawing in the same folder as the part and save it with the same name.
How I can get the name of the part and the path of the part?
You can use this statement to get the document name without its path and extension
sModelName = Left(swModelDoc.GetTitle, InStrRev(swModelDoc.GetTitle, "-") - 2)
The basic version of that would be:
drawingPath = Left$(swModel.GetPathName, (Len(swModel.GetPathName) - 6)) & "SLDDRW"
I had to look up the function of the dollar sign in VBA, it's to make sure Left returns a string. You can add other necessary checks accordingly.
Retrieving data ...