1 Reply Latest reply on Aug 28, 2015 1:25 PM by Deepak Gupta

    Move object to folder with macro

    Lasse Nielsen

      I have this Macro that inserts a virtual file into an open assembly file, then renames it. Now i want to move a folder called "Tubes" (See template file. The one thing i think i'm missing is the Source. But I cannont figure out how to format that correctly. Can someone help me?

        • Re: Move object to folder with macro
          Deepak Gupta

          Add these lines after swComponent.Name2 = "NewFileName"

           

          swAsm.Extension.SelectByID2 swComponent.Name2 & "@" & swAsm.GetTitle, "COMPONENT", 0, 0, 0, True, 0, Nothing, 0

          Set swComponent = swAsm.SelectionManager.GetSelectedObject6(1, -1)

          swAsm.ReorderComponents swComponent, swTubeFolder, 3 (you can edit this older line or use this new one)