This content has been marked as final.
Show 2 replies
-
Re: How to use api to find out the part name during creating drawing?
Peter Brinkhuis Apr 13, 2017 2:09 PM (in response to Marco Wu)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.
-
Re: How to use api to find out the part name during creating drawing?
Christian Chu Apr 13, 2017 2:18 PM (in response to Marco Wu)You can use this statement to get the document name without its path and extension
sModelName = Left(swModelDoc.GetTitle, InStrRev(swModelDoc.GetTitle, "-") - 2)