Macro to disable one or more layers in a Solidworks drawing

Hello

 

I'm looking for a piece of code (VBA) to unzip layers in a MEP.

 

Explanation:

I have to export a file in DXF without anything but the outline (for the laser).

I managed to remove the background from my drawing... but I would like to "cleanse" my unfolded view.

All the annoying elements are on layers so by deactivating these layers I no longer have problems.

But I can't do it.

By recording the macro manually I don't get anything...

If anyone can help me.

Thanks in advance

Hello, if it's done with the sheet metal module you can very easily export a dxf from the 3D (from the save as file or the unfolded function).

Otherwise for a macro see this example:

http://help.solidworks.com/2012/English/api/sldworksapi/Turn_Layer_Visibility_On_and_Off_Example_VB.htm

1 Like