Saving the API configuration

Hi all

I resolve to come and ask the question here because I can't find the answer anywhere... I created a macro to automatically save the parts of my assembly in .slddrw. So far it works, the problem is that this assembly is composed of several times the same part in a different configuration! So instead of creating different plans (which happens when I do it manually), I just save plans in the same room configuration.

Ex: my assembly contains:

  • Exhibit 1
  • Exhibit 2 (conf 1)
  • Exhibit 2 (conf 2)

And I get the same plan for the 2 different configurations.

My code is (very simplified version):

Set Part = swApp.NewDocument(Modelsheet, 2, 0.2794, 0.4318) 'ouvre une MEP selon le model de fond


Set myView = Part.CreateDrawViewFromModelView3(sPathName, "*Dessus", PosX, PosY, 0) 'cree la vue de dessus a cette position

Part.ClearSelection2 True

Part.SaveAs (savepath) 
swApp.CloseDoc savepath

Thank you to all those who will be able to help me

 

Hello

Does the created plan match the active configuration in which the 3D model is stored? ?

Kind regards

1 Like

Hello

In view of the code at no time you take into account the configuration so it won't do it by itself:)

4 Likes

Hello

Here is an example of a macro that allows you to change the configuration of each view of a plan, you must be able to play with it in order to change the configuration of all the views of your plan, to be put between creation and saving.

Kind regards

 

 


multiconfigswdraw.swp
3 Likes

Thank you very much for your answers! I apologize for the delay but an unforeseen event has cut me off a little in the meantime.

It's good (and simply)". ReferencedConfiguration" which was missing from my sight, everything is functional now!

Thank you!