Virtual the components of a macro assembly

Hello

How do you make the components of an assembly virtual using a macro?

The macro recorder doesn't give anything special, and after a few searches the Makevirtual function doesn't seem to work either, I don't really see the method to use to do this by macro.

Thank you in advance for your answers.

Hello

See examples of use in color attachment.

Can you post your code in a text file and tell us on which line you have an error?


makevirtual_solidworks.pdf

Hello

thank you for the answer on the makevirtual, it works....

I'm posting my code in a text file because I want to improve my macro.

The purpose of this macro is to quickly save the import files that you download.

For part files, it works fine:

- We open the step, and we launch the macro which offers the user to save the file in the Commerce directory where all our commercial components are stored, then close the file.

For assembly files, it gets a little more complicated:

- we open the step

- we launch the macro

- a first registration must be made in order to be able to make the components of the assembly virtual

- we make a new record to store it in the right trade directory

My improvement that I would like to make would be for the first record to be done in a transparent way and for the second record that the macro offers the user the trade directory.

Thank you in advance.


save_import.txt