Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Routine to change Lineweight of a Layer and a Xref Layer

  1. #1
    All AUGI, all the time TerribleTim's Avatar
    Join Date
    2006-03
    Location
    Tacoma, Wa
    Posts
    643
    Login to Give a bone
    0

    Default Routine to change Lineweight of a Layer and a Xref Layer

    Hey gang. I need a little help. I don't know squat about LISP routines and writing them. I really need to get on top of that skill! But here is what I need to do. I have a set of about 30 drawings, every one of them needs a layer in the x-ref to have the lineweight of one layer (the same layer in every drawing) changed. Is there a fast way to do it as opposed to opening each one, making the change, and saving?

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    Same layer in the same XREF? Does the XREF have the same Reference name in each drawing?

    Create a script file containing the command line inputs you would do if you had to do it manually. You might do one drawing and copy the command history to notepad to edit.

    If you need help with that post back.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    All AUGI, all the time TerribleTim's Avatar
    Join Date
    2006-03
    Location
    Tacoma, Wa
    Posts
    643
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    Yes, the x-ref has the same name in each drawing. Also, i forgot I also have to change the lineweight on one layer in each drawing (not the x-ref, and again the same layer name in each drawing). So to sum it up, I need to change lineweight setting in one layer in each drawing, each one having the same layer name, and change one layer in the x-ref in each of those drawings. The problem is, I don't even know where to start with the LISP.

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    If you are just changing properties of layers, you can do that with the command line version of the LAYER command. Doing that, you can write a script file that you can execute on each drawing.

    What are the two layer names and their desired property changes?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    All AUGI, all the time TerribleTim's Avatar
    Join Date
    2006-03
    Location
    Tacoma, Wa
    Posts
    643
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    Layer in the drawing is "G-ANNO-TTBL", lineweight needs to be 0.022. Layer in x-ref is "A-TBHT", lineweight needs to be 0.018. Thanks for the help thus far!

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    Quote Originally Posted by TeriblTim
    Layer in the drawing is "G-ANNO-TTBL", lineweight needs to be 0.022. Layer in x-ref is "A-TBHT", lineweight needs to be 0.018. Thanks for the help thus far!
    What is the reference name of the XREF? You kind find this by listing the XREF. It will give you the name similar to a block name.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #7
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    Here's a quick one you would run per drawing, you would need to put the exact xref name in where it seys "XREFNAME".

    Code:
     (defun c:fixlayers ()
     (command "-layer" "lweight" "0.022" "G-ANNO-TTBL" "" "")
     (command "-layer" "lweight" "0.018" "XREFNAME|A-TBHT" "" "")
     (princ)
     )
    Does that help?

  8. #8
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    Quote Originally Posted by tedg
    Here's a quick one you would run per drawing, you would need to put the exact xref name in where it seys "XREFNAME".

    Code:
     (defun c:fixlayers ()
     (command "-layer" "lweight" "0.022" "G-ANNO-TTBL" "" "")
     (command "-layer" "lweight" "0.018" "XREFNAME|A-TBHT" "" "")
     (princ)
     )
    Does that help?
    You could change the XREFNAME to an asterisk [*] to use it as a wild card for the string.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  9. #9
    All AUGI, all the time TerribleTim's Avatar
    Join Date
    2006-03
    Location
    Tacoma, Wa
    Posts
    643
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    Very cool, guess you don't need the x-ref name huh? It is "36023A-Border3042.dwg". But I think I could handle sticking that in. So you open the drawing and then run this script? Still have to open each one huh? Oh well, guess that's why I make the big bucks (LOL!). Thanks guys for all the help.

  10. #10
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Routine to change Lineweight of a Layer and a Xref Layer

    Quote Originally Posted by Opie
    You could change the XREFNAME to an asterisk [*] to use it as a wild card for the string.
    Oh yea, that would work too, (provided there's not another xref drawing with that layer name he doesn't want changed).

    Good idea.

    A script may be the way to go for this though, it works outside of AutoCAD and could open, modify, save and close the drawings when done.

    I don't know how to write that code though, I can do simple scripts.

Page 1 of 2 12 LastLast

Similar Threads

  1. Layer Name Change Routine
    By newfoundfreedom in forum AutoLISP
    Replies: 11
    Last Post: 2023-02-08, 12:17 PM
  2. Help with while loop, layer lineweight change
    By jeff.richards in forum AutoLISP
    Replies: 5
    Last Post: 2009-02-23, 04:00 PM
  3. Replies: 6
    Last Post: 2007-05-30, 05:45 PM
  4. assign layer lineweight based on layer color
    By kjbusacker in forum AutoLISP
    Replies: 9
    Last Post: 2007-03-01, 03:15 PM
  5. Replies: 2
    Last Post: 2006-03-29, 03:42 PM

Posting Permissions

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