AnsweredAssumed Answered

Extract my part number from my file name (macro?)

Question asked by Mike Helsinger on Sep 22, 2014
Latest reply on Nov 4, 2014 by Mike Helsinger

I have my drawing template set up to receive title block entries from my part file's custom properties.  I'd like to go a step farther and extract my part number and revision from the file name without explicitly entering the info in custom properties / title blocks.  I'm seeing similar queries in other threads but I don't know enough about macros to successfully patch one of my own together for my scenario.  Here's some specifics of my file structures:


  • part file & drawing file are always named identical to each other
  • Part number can be any length of alphanumeric characters and often includes a "-" (dash)
  • Revision may be one, two, or more characters, may include be a "-" (dash) or " " (space)
  • file name format is "(part number) Rev (revision)
  • example
    • part number is 101010-201
    • revision is C SUB B
    • file name is 101010-201 Rev C SUB B.sldprt


Is it possible to get there from here?