3 Replies Latest reply on Jul 23, 2016 12:39 PM by Deepak Gupta

    Macro to seperate file name

    Antonio Cavka

      Hi all,

      I have many  old projects and need them to populate with custom properties.

      If possible i need something like this:


      And i want to display "SW-FILE NUMBER" in one custom property row and "SW FILE NAME" in second row.

      I have real many parts and i need to change all sheet formats and about 10 custom properies to populate manual and tray to make it faster then by now...

      ""_""shud be the breaker line between two options.



        • Re: Macro to seperate file name
          Peter Brinkhuis

          You could use #TASK to run a macro on a large set of parts. I have been wanting to try it, because I created a few macros in the past that would iterate over a folder or a set of files. #Task would allow me to ditch the part of my code that would look up files.


          I think the macro for adding custom properties would need to follow these steps:

          1. Open a file (or let #Task do that for you)
          2. Find the file location using GetPathName and get the file name using In String Reverse (InStrRev) with a slash ( / ) as the divider
          3. Split the file name into two variables using In String if an underscore is only ever used in that location. Or maybe there are always four characters in the file name that you want to put into the first custom property?
          4. Create a Custom Property Manager as shown in this example
          5. Add all of the custom properties that you need as shown in the example above


          Need more help? Just ask