API Component Replacement

Hello

 

I'm currently on a macro that automatically mounts the standard components of my company. To avoid having too heavy assemblies I created several levels:

Assembly 1 

    Assembly 1.1

    Assembly 1.2

    Exhibit 2

    Exhibit 3

Assembly 2

    Exhibit 1

    Exhibit 2

    Assembly 2.1.....

 

At the end of my editing, the macro automatically saves my components following the tree structure to have a correct file at the end.

Now let's move on to the problem, in case the file already exists I ask for confirmation to overwrite the file, if the user doesn't want to I propose a component replacement but there I can't succeed anymore. 

 

To replace a component we have to preselect it with 'SelectbyID2' but the writing is "8500-1@9800"  or "9800-2@9900/8700-1@9800"  (component 8700 which is in assembly 9800, which is itself in assembly 9900) For registration it's a bit simpler.

 

I wanted to know if there is a function that allows you to have the full path (9800-2@9900/8700-1@9800) or if you have to define it yourself. Which can quickly become complicated since I manage different levels at the same time.

 

Kind regards

I finally found the solution to my question, I deleted the code given the general appeal for the question and I believe that it remains intellectual property, if you want information I can still be reached in mp.

 

So you can't define the path with a 'simple' function, so I made variables to define the path.

On the other hand, it creates a new problem for me that will give way to a new question.