Convert Solidworks Assembly Drawing to AutoCAD layout

Discussion in 'SolidWorks' started by Anthony Honeyfield, Dec 9, 2003.

  1. Hi,

    In an old thread called "Re: Which addin do you need" (dated April
    2003) I asked for a macro that would put every component in a
    Solidworks wireframe assembly drawing on a different layer. The
    drawing could then be saved as an AutoCAD dwg file, and worked on in
    AutoCAD in the traditional way.

    The good news is that I finally discovered the macro. If you go to:

    http://files.solidworks.com/API/Examples/00000/0200s/0253/Example.htm

    ....there is a visual basic file called:

    "How to put all assembly components in a drawing view on different
    layers".

    If you cut and paste the contents of this file into an empty
    Solidworks Macro, then follow the instructions in the file, it should
    work out fine.

    There appears to be a double up in layer names if the same part is
    used in multiple assemblies. It would also be nice to have a random
    colour assigned to each layer. If anyone knows how to do either of
    these, please post.

    Regards,

    Anthony
     
    Anthony Honeyfield, Dec 9, 2003
    #1
  2. Philippe Guglielmetti, Dec 9, 2003
    #2
  3. May I ask why you "guess" so instead of trying ?
    It works perfectly on SW2003, and it should work even on SW2001+.
     
    Philippe Guglielmetti, Dec 9, 2003
    #3
  4. Philippe,

    Thanks for the link to your script.

    I have tried the script (in SWx 2003) and found that it puts every
    part on the same layer, and in fact strips the layer name such that
    ABC-361-001 becomes layer name ABC.

    The layer does seem to have a random colour assigned, though.

    Any idea's what's wrong?

    Thanks,

    Anthony
     
    Anthony Honeyfield, Dec 10, 2003
    #4
  5. Phillippe,

    A bit more research has uncovered the following:

    We use a naming convention whereby each part is given the name
    ABC-400-001 or similar. The 400 number refers to a process (ie.
    injection moulding, turning, etc) hence an assembly would consist of
    something like:

    ABC-400-056
    ABC-200-001
    ABC-100-032

    ....and so on. Your script sees all of these as the same, and puts
    them on one layer called ABC. If I rename the parts as:

    Fred
    Jane
    Sam

    ....the script works as intended.

    How do you change the script to remove this sensitivity? I think our
    naming convention is quite common.

    Regards,

    Anthony
     
    Anthony Honeyfield, Dec 10, 2003
    #5
  6. yes, sorrys, stupid mistake: just change the line :
    name = Left(name, InStr(name, "-") - 1)
    into:
    name = Left(name, InStrRev(name, "-") - 1)

    or re-download the updated macro.

    Part names weren't supposed to contain "-" characters as they mix with the
    "-1" "-2" ... SolidWorks adds to number components...
     
    Philippe Guglielmetti, Dec 10, 2003
    #6
  7. Anthony Honeyfield

    skiboat Guest

    Is it also possible to make each component into an Autocad block?
     
    skiboat, Dec 11, 2003
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.