+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 31
  1. #1
    Full Member
    Computer Details
    DreadPirateRoberts's Computer Details
    Operating System:
    Windows 7
    Discipline
    Manufacture
    DreadPirateRoberts's Discipline Details
    Occupation
    Drafting and Design Technician
    Discipline
    Manufacture
    Using
    Inventor 2013
    Join Date
    Jun 2011
    Location
    Frederick, Maryland
    Posts
    28

    Default Changing Layer colors for hundreds of drawings

    Registered forum members do not see this ad.

    Hi all,

    I'm just starting to learn how useful AutoLISP can be and I want to ask if what I am trying to do is possible...
    I have about 500 separate CAD drawings, all with the same layer names. Layer A, lets say, is currently yellow, I need it to be magenta.

    I'm thinking I need to write something that will open each drawing, change the layer color, save it, then close the drawing? Is this a good direction to head?
    This could just be done with a big long script right?

    Thanks for the help, I'm going to keep researching about how to create autoLISP routines to edit this large database of drawings since it REALLY seems to beat the idea of editing each of them individually!

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,090

    Default

    Sounds like a job (batch process a group of drawings) a script could handle.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  3. #3
    Full Member
    Computer Details
    DreadPirateRoberts's Computer Details
    Operating System:
    Windows 7
    Discipline
    Manufacture
    DreadPirateRoberts's Discipline Details
    Occupation
    Drafting and Design Technician
    Discipline
    Manufacture
    Using
    Inventor 2013
    Join Date
    Jun 2011
    Location
    Frederick, Maryland
    Posts
    28

    Default

    Hi there,

    So here is the script I'm trying to run:

    Code:
    -layer color magenta Guidelines  qsave
    which changes the layer color of the layer 'Guidelines' to magenta. This works fine with the command 'scr' on an individual drawing that I have open in AutoCAD. I wanted to use ScriptPro 2.0 to select the 500+ drawings I want this to act on but....ScriptPro doesnt seem to do anything.
    I run ScriptPro and it opens up a blank AutoCAD program, but the drawings are unchanged.
    I tried not using ScriptPro, but I am having trouble writing the script that opens up an existing drawing. It keeps trying to open the file, but a popup window says something like '...please verify the file exists'. Even though I am pretty sure I have the path correct.

    Any idea what I'm doing wrong?

  4. #4
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,090

    Default

    That is the extent of your script?

    No command to open a drawing, or save and close the drawing?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  5. #5
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,732

    Default

    I don't use ScriptPro so couldn't advise you in that respect, but to offer an alternative, here is an old program of mine that may help you:

    http://lee-mac.com/scriptwriter.html

    Excuse the terrible coding, the program needs a major overhaul!
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  6. #6
    Full Member
    Computer Details
    DreadPirateRoberts's Computer Details
    Operating System:
    Windows 7
    Discipline
    Manufacture
    DreadPirateRoberts's Discipline Details
    Occupation
    Drafting and Design Technician
    Discipline
    Manufacture
    Using
    Inventor 2013
    Join Date
    Jun 2011
    Location
    Frederick, Maryland
    Posts
    28

    Default

    Yup, that's the extent of my script. I left out the open and close portions because I thought ScriptPro handled those portions. But I can put in the open and close portions like this:
    Code:
    open "Drawing1" -layer color magenta Guidelines  qsave close
    open "Drawing2" -layer color red Guidelines  qsave close
    But at this point I'm too lazy to copy the file paths for each drawing (LOTS of sub-directories there...) in place of "Drawing#". Which is why ScriptPro sounded so appealing. I'd love to figure this out so I can use it again in other situations. There aren't too many settings to tweak in ScriptPro, so I'm confused why its not working.

    Lee Mac, I can give your program a try when I get home tonight (they are pretty picky about what I can download here at work).

    Thanks for the help

  7. #7
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,732

    Default

    Quote Originally Posted by DreadPirateRoberts View Post
    Lee Mac, I can give your program a try when I get home tonight (they are pretty picky about what I can download here at work).

    Thanks for the help
    No worries, let me know how you get on
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  8. #8
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,090

    Default

    You don't have to copy the file path for each and every drawing. It's a batch file. As long as you point it to the right folder it will batch process the contents of the entire folder.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  9. #9
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,732

    Default

    Quote Originally Posted by ReMark View Post
    You don't have to copy the file path for each and every drawing. It's a batch file. As long as you point it to the right folder it will batch process the contents of the entire folder.
    However, to my knowledge, the problem with using a Batch file to process drawings is that it will unnecessarily close and re-open the AutoCAD Application for every drawing processed; whereas, using only a Script to process drawings enables much faster processing since drawings can be opened and closed in a single instance of the Application.
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  10. #10
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,090

    Default

    Registered forum members do not see this ad.

    That is a good point Lee. I should have been more precise in what I was saying. Thanks.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

Similar Threads

  1. changing all colors in drawing regardless of layer, block
    By NoelStalker in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 12
    Last Post: 8th Mar 2012, 04:01 pm
  2. Help changing this LISP routine so I can select hundreds of lines at once?
    By PlutoISaPlanet in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 25th Apr 2011, 01:52 am
  3. Change pastel colors to alternative colors by layer & elements & blocks
    By deucer in forum AutoLISP, Visual LISP & DCL
    Replies: 12
    Last Post: 23rd Jul 2010, 06:13 pm
  4. Overlay, compare drawings and changing colors
    By uahmad in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 27th Nov 2008, 03:29 am
  5. Layer colors changing when I switch to paper space
    By Muxe in forum AutoCAD General
    Replies: 2
    Last Post: 10th Sep 2007, 08:33 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts