VB: Is there a way to separate the filename from the title shown in SW?

Feb 05, 2004 1 Replies

Hi everybody,



does anyone happen to know if the Solidworks VB-API provides a function through which it's possible to separate the title of a part or assembly from its actual filename? I have a set of files that already exist, some possibly with identical names. When I import them into our EDM system, the system gives every file a new unique name. I'd like to use that new name whenever an engineer checks out a file but it would be desirable if Solidworks used the original name in the model tree and window title.



I've looked into ModelDoc2::SetTitle2 but it only works with new files that haven't been saved yet....any ideas?



Thanks a lot! Tobias



How about ModelDoc2.GetPathName? That will return the full filespec of the document. Having the complete path lets you deal easily with duplicate file names.

To strip off the pathname from the full filespec, check out the "Split" function, using a "\" as a delimiter. The "Split" function is a VB/A function, and should port just about anywhere.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required