save dwg with one layer per each part

Hi, I looking for macro (or other solutions) that allow me to save dwg from assembly

with one layer per each part I have in the assembly.

As an example:

Myassemb.sldasm contains

- bolt.sldprt

- sheet1.sldprt

- sheet1.sldprt

- sheet2.sldprt

- shaft1.sldprt

- shaft1.sldprt

- shaft1.sldprt

I want my dwg contains this layer

bolt

sheet1

sheet2

shaft1

There are something can help me?

SolidworksApi macros
Answers 6
SF
SF 2012-05-29 Best Answer

Luca,

If you don't get enough good responses here, you might want to ask this question in the API forum, where the macro experts go.

Jerry Steiger

LR
LR 2012-05-29

Hi Jerry, tnx for your suggest, could you move my post there? => API forum?

DG
DG 2012-05-30
<p>Luca Reggiani wrote:</p><p></p><p>could you move my post there? => API forum?</p>

Yes, click on move discussion on the right side under Actions and then select the appropriate section.

LR
LR 2012-05-30

Tnx, now i waiting for help

(I reply to you here with this, in order to show in this forum my name and not yours as last replyer - If someone look your name or Jerry names as last, could think you have already solve my problem ;P)

LR
LR 2012-06-02

... I can not believe that this topic is never approached by anyone ...

I just find this (http://help.solidworks.com/2010/English/api/sldworksapi/Put_Assembly_Components_in_Drawing_View_on_Different_Layers_Example_VB.htm) now i try to understand how to use this code...

DG
DG 2012-06-04

I did tried pulling the details but I get instance ID with file name which I'm trying to remove.

The macro you posted above does the same thing i.e. it take the part name with the instance number which means if same part has been inserted twice, then there will be two different layer for them. This is what I'm trying to fix.