Macro Open room configuration from drawing according to the config of the 1st view

Hello

I'm looking for the codes to make a macro in solidworks that allows you to open a room from its drawing.

Be careful, I want to open the room in the configuration of the first view of the drawing.

 

example:  

In the part file,  I have several widths in configuration   1000- 1200 - 1400 -1500

So if my first view of the drawing corresponds to the 1000 configuration, I want the macro to open the part file in the 1000 configuration.

Clearly, this is what is worth right-clicking on the drawing and opening the piece file.

Thank you for your answers

 

 

Uh... ba why make it complicated rather than a right click and open the file then?

 

That said, to be more in line with your project, the difficulty will be in the selection of the first view. I'm not sure he knows how to do that kind of thing

2 Likes

My wish is to make a macro to make a step file of the open drawing and especially the step file of the configuration concerned by the drawing, hence the need to open the part file in the right config for the recording.

I already have the rest of the macro but it opens the part file in the config of the last recording and not in the config of the drawing.

 

Good evening

In the options to open, add the conf resulting from the analysis of the view, i.e. swView. ReferencedConfiguration

If it's opendoc6, that's the 4th criterion.

1 Like

Hello

The correct answer is in the attached code snippet. The function to use to open is swapp. ActivateDoc3.


openpartfromview.txt