I try to record a macro to start with. However, nothing is really shown when I move the part from folder to folder.

 

Here is the task.

I have 5 folders in the assembly tree

1. Assemblies

2. Parts

3. Purchased Parts

4. Fasteners

5. Outside BOM

 

I need to move assemblies will be in folder #1. Moreover, they needs to be sort filename in alphabetical order.

I need to move parts with vendor name (properties field) = AAA to folder #2 and then sort filename them in alphabetical order.

I need to move parts with vendor name (properties field) NOT = AAA to folder #3 and then group them by vendor name and then sort them in filename alphabetical order.

I need to put all toolbox fasteners in folder #4 and sort by name

I need to put all enveloped part/assembly in folder#5 and sort by name

 

I really need help on this. Please help


Categories: API∕Macros

Comments
Last comment By: Fernando Castro   Sat, 13 Jan 2018 03:01:34 GMT
Re: How to sort assembly tree using macro?

Even if there is no complete answer, any suggestion or direction will be still great.

By: Marco Wu  Wed, 07 Jun 2017 22:06:31 GMT
Re: How to sort assembly tree using macro?

You'll probably need to process this in a few steps.

 

  1. Create arrays or lists for each type of component (Assembly, Part, Purchased, Fastener, Outside BOM)
  2. Create folders
  3. Get Assembly Components
  4. Loop through the components
    1. If component is envelope, add to 'Outside BOM'
    2. If component is an assembly, add to 'Assembly'
    3. If component is toolbox, add to 'Toolbox'
    4. If component is a non-toolbox part, read custom properties and add to 'Part' or 'Purchased'
  5. Sort lists
  6. Move components to folders using ReorderComponents

 

Good luck and have fun

By: Andrew Johnson  Wed, 07 Jun 2017 22:14:07 GMT
Re: How to sort assembly tree using macro?

I found a macro from 3dcontentcentral

 

 

It does 85 % of what I need. Except I need to sort by vendor and then part no. It sorts by file name.

 

Note: I do not need to create new folder. The parts are in the folders. I need to sort them only . Would you please help ?

 

Please see the attached macro

By: Marco Wu  Wed, 07 Jun 2017 22:55:47 GMT
Re: How to sort assembly tree using macro?

Im currentrly working on a macro to do all of that.

 

Scan the assembly. find in the properties if the part or assembly corresponding of each category, then create the respective folders, and then proceed to move the components to their respective folders. all fo this i pretend to do it to export the files on a directory as it is on the tree too-

 

if every thing works fine i must have it ready by the 15 of january... i need to document, sort and rename, and update a lot of previous work, and i do not pretend to do it manually... i already invested a lot of time on this macro (i didn´t know OOP untill today) but it will  pay itself with the time tha i am going to save from now

By: Fernando Castro  Sat, 13 Jan 2018 03:01:34 GMT
You are not authorized to view this page No results found! Suggestions: Check spelling, try a different search, or browse topics below.