codestack icon indicating copy to clipboard operation
codestack copied to clipboard

Rename all parts/subassemblies in assembly, inherit properties

Open Berglid opened this issue 4 years ago • 0 comments

Hi.

Would like to request a macro that recursively renames parts and subassemblies within an assembly with a similar logic as shown below, where the order of parts in the design tree matters. If a drawing with the same name is found it is also renamed. Would be good if it worked with batch+, and only preselected parts are renamed.

  • Main assem - 12345-A00 (User names main assembly)
    • subassem1 - 12345-A01 (Original file name - new file name) (Project No-Assembly/Part/Weldment Increasing number)
      • part3 - 12345-P03
      • part4 - 12345-P04
      • part5 - 12345-P05
    • subassem2 - 12345-A02
      • part6 - 12345-P06
      • part7 - 12345-P07
    • Weldment1 - 12345-W00
    • part1 - 12345-P01
    • part2 - 12345-P02
    • Folder1 (toolbox)
      • Fastener1
      • Fastener2
    • Folder2 (supplier parts)
      • Step1
      • Step2
      • Random Part

To avoid accidentally renaming parts that are not intended to be renamed (even with preselecting), the macro should exclude the following

  • toolbox components and step files by default.
  • Any parts assemblies placed in a folder with a certain name. A list of folder names is defined in the macro (not case sensitive) that are excluded from the macro
  • Check if any document names start with the same project number as the main assembly (e.g 12345) before any renaming happens. If so a warning is given, and the user is given 2 options
    • Proceed anyway
    • Only inherit custom properties (described below)

The following could be a macro by itself: All parts/subassemblies inherit a set of properties from the main assembly.

  • $Client
  • $Project
  • $Project No

Part/Subassemblies inherits properties from its parent assembly

  • $Assembly (parents assembly Part No)

Berglid avatar Jun 16 '21 08:06 Berglid