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

Discussion in 'SolidWorks' started by Tobias Begalke, Feb 5, 2004.

  1. 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
     
    Tobias Begalke, Feb 5, 2004
    #1
  2. Tobias Begalke

    rocheey Guest

    through which it's possible to separate the title of a part or assembly
    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.
     
    rocheey, Feb 5, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.