Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Move Objects to layers

Status
Not open for further replies.

Rene_I-deas_User

Mechanical
May 25, 2022
3
0
0
GB
I have developed these journals from various parts of journals I found online. The journals are to move objects to layers. The idea is that the user inputs the layer he would like the object type to move to and the script moves the objects accordingly. This works well for a single component but now I want to extend it to recursively move all the subassemblies / components to the same layers. The issue I have hit is that the layer variable (value is set by user input) is declared for each item type in the main sub but doesn’t carry down to the sub where the recursion happens, and I don’t know how to get this to happen. I tried making the declaration a public variable, but the value just resets to 0 for the second sub and doesn’t hold the user input value.

What I would really like is my final journal to ask the user whether they want to process just the work part or the workpart structure. Depending on the user input, the journal would then just process the work part or process the structure under the workpart.

Any help / advise would be appreciated….

Many thanks...

René
 
 https://files.engineering.com/getfile.aspx?folder=2c2108c1-d245-46c8-977a-927a076a9d5f&file=move_to_layer_-_assembly_structure.txt
Status
Not open for further replies.
Back
Top