+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Senior Member Attila The Gel's Avatar
    Computer Details
    Attila The Gel's Computer Details
    Operating System:
    Windows XP SP3
    Computer:
    Toshiba laptop
    Motherboard:
    ...
    CPU:
    ...
    RAM:
    ...
    Graphics:
    ...
    Primary Storage:
    ...
    Monitor:
    ...
    Using
    AutoCAD 2010
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    219

    Default On the fly layer select/Change!

    Registered forum members do not see this ad.

    Hi all,

    I was wondering how to set the right layer while you are drawing a line. (if this is possible off course)

    Lets say I have 2 line colors (blue and red) in a layer called "Y" and I'm currently drawing in another layer called 'X'.
    Here's what I would like to do if possible.
    Whilst I'm in layer 'X' I want to start a line but I want it to change to the Layer 'Y' and the color RED by clicking on the red line of that layer that is already in the drawing.
    Therefore not always go to the layer after I draw the lines or before I draw the lines.

    I hope the badly formed text above

    thx

  2. #2
    Super Member skipsophrenic's Avatar
    Computer Details
    skipsophrenic's Computer Details
    Operating System:
    Vista 32 bit
    Computer:
    Compaq
    Motherboard:
    erm . . yeah?
    CPU:
    Intel Pentium Dual CPU E2140 @ 1.60 Ghz
    RAM:
    2039MB
    Graphics:
    don't ask you'll kill me
    Primary Storage:
    360gb
    Monitor:
    21" widescren - 16:10 ratio
    Using
    AutoCAD 2008
    Join Date
    Jul 2008
    Location
    Birmingham, United Kingdom
    Posts
    1,020

    Default

    i don't know if this is what you're askin soz, but it reads like

    1. draw line on layer 'x' an colour blue,
    2 while drawing line realise should be on layer 'y' and colour red
    3 change it in mid-command to save changing later?

    Is this what you're getting at?
    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein

    SET FILEDIA = 1

  3. #3
    Senior Member Attila The Gel's Avatar
    Computer Details
    Attila The Gel's Computer Details
    Operating System:
    Windows XP SP3
    Computer:
    Toshiba laptop
    Motherboard:
    ...
    CPU:
    ...
    RAM:
    ...
    Graphics:
    ...
    Primary Storage:
    ...
    Monitor:
    ...
    Using
    AutoCAD 2010
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    219

    Default

    Thats about it skipsophrenic!

    Nice. Is there some way to do this?

  4. #4
    Forum Deity rkent's Avatar
    Computer Details
    rkent's Computer Details
    Operating System:
    WIN7 PRO 64bit
    Computer:
    Dell Precision T7500
    CPU:
    Xeon Dual Core E5503 2.0Ghz
    RAM:
    6GB DDR3 ECC SDRAM, 1333MHz, 6x1GB
    Graphics:
    nVidia Quadro 3800
    Primary Storage:
    300Gb, 10K rpm
    Monitor:
    Dell 24" FS (2x)
    Discipline
    Mechanical
    rkent's Discipline Details
    Occupation
    Facilities Design - Semi-conductor manufacturing
    Discipline
    Mechanical
    Details
    Designer: Process Piping, P&ID's, Machine Part Design, Planning / General Arrangement. Facilities Management. Drafting: Electrical, Controls, Architectural.
    Using
    Mechanical 2014
    Join Date
    Nov 2007
    Location
    Lat:35, Long:-106, Elev: 5164'
    Posts
    3,375

    Default

    I found this old routine I use for changing layers by picking. I changed it to work transparently and it seems to work.
    So you load the file each time, through appload for example, and then after you have started the line command you can type 's "enter", pick a line on a layer you want to draw on and continue.

    (defun C:S (/ e n);set current layer by picking entity
    (setq e (car (entsel "Set Current Layer...\nPICK OBJECT: ")))
    (if e (progn
    (setq e (entget e))
    (setq n (cdr (assoc 8 e)))
    (command "'.LAYER" "SET" N "")
    ))
    )
    "You are entitled to your own opinion but you are not entitled to your own facts." Daniel Patrick Moynihan

  5. #5
    Super Member
    Computer Details
    wannabe's Computer Details
    Operating System:
    XP
    Using
    AutoCAD 2007
    Join Date
    Oct 2008
    Location
    Birmingham, UK
    Posts
    772

    Default

    Does this really save that much time?

  6. #6
    Senior Member Attila The Gel's Avatar
    Computer Details
    Attila The Gel's Computer Details
    Operating System:
    Windows XP SP3
    Computer:
    Toshiba laptop
    Motherboard:
    ...
    CPU:
    ...
    RAM:
    ...
    Graphics:
    ...
    Primary Storage:
    ...
    Monitor:
    ...
    Using
    AutoCAD 2010
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    219

    Default

    Quote Originally Posted by rkent View Post
    I found this old routine I use for changing layers by picking. I changed it to work transparently and it seems to work.
    So you load the file each time, through appload for example, and then after you have started the line command you can type 's "enter", pick a line on a layer you want to draw on and continue.

    (defun C:S (/ e n);set current layer by picking entity
    (setq e (car (entsel "Set Current Layer...\nPICK OBJECT: ")))
    (if e (progn
    (setq e (entget e))
    (setq n (cdr (assoc 8 e)))
    (command "'.LAYER" "SET" N "")
    ))
    )
    Thx. I'll try this out tomorrow and let you know!

    But does it also copy the linetype and color when you pick an object?

  7. #7
    Forum Deity rkent's Avatar
    Computer Details
    rkent's Computer Details
    Operating System:
    WIN7 PRO 64bit
    Computer:
    Dell Precision T7500
    CPU:
    Xeon Dual Core E5503 2.0Ghz
    RAM:
    6GB DDR3 ECC SDRAM, 1333MHz, 6x1GB
    Graphics:
    nVidia Quadro 3800
    Primary Storage:
    300Gb, 10K rpm
    Monitor:
    Dell 24" FS (2x)
    Discipline
    Mechanical
    rkent's Discipline Details
    Occupation
    Facilities Design - Semi-conductor manufacturing
    Discipline
    Mechanical
    Details
    Designer: Process Piping, P&ID's, Machine Part Design, Planning / General Arrangement. Facilities Management. Drafting: Electrical, Controls, Architectural.
    Using
    Mechanical 2014
    Join Date
    Nov 2007
    Location
    Lat:35, Long:-106, Elev: 5164'
    Posts
    3,375

    Default

    Quote Originally Posted by Attila The Gel View Post
    Thx. I'll try this out tomorrow and let you know!

    But does it also copy the linetype and color when you pick an object?
    This simply changes to another layer that you select. The color should be set bylayer as well as linetype. Maybe we aren't understanding what you are really after.
    "You are entitled to your own opinion but you are not entitled to your own facts." Daniel Patrick Moynihan

  8. #8
    Full Member Jaelin's Avatar
    Computer Details
    Jaelin's Computer Details
    Operating System:
    Windows XP (Service Pack 2)
    Computer:
    HP Workstation xw6200 (piece of junk :) )
    CPU:
    Intel Xeon CPU 3.40ghz
    RAM:
    4GB
    Graphics:
    NVIDIA Quadro NVS 280 PCI 64MB
    Primary Storage:
    300GB
    Monitor:
    HP p930 & HP 1955
    Using
    Civil 3D 2009
    Join Date
    Dec 2008
    Location
    Bartow, Florida
    Posts
    86

    Default

    I've worked up a toolpallette to cover for my purposes what i think might help you. It won't allow you to change in the middle of drawing a line but it will allow you to draw a line on a different layer without changing your layer. Hopefully I can explain this to where you understand what I'm doing. This takes a while to setup but if your using consistent layering on every job like I do it comes in handy for me.

    I took the a flyout that consists of 8 draw commands: line, arc, circle, ellipse, polyline, ray, spline and constuction line. Typically I only use the line, arc, circle, polyline and spline commands.

    I took that flyout and dropped it into a tool pallette I named linework. I then copied that flyout multiple times into that same tool pallette. In my case about 30 times. I then went into each of those flyouts and edited the properties of the flyout.

    I changed the name of the flyout to correspond with the layer, I selected the Layer I wanted to tie the flyout to and then put all the other settings on "ByLayer."

    What this resulted in for me is all I have to do is now click on the button for the flyout and I can draw a line of that type and color then immediately click a different flyout and draw a line of another type/color.

    It cut my time in half almost drawing linework for what I do. Hopefully this will help you.

  9. #9
    Super Member skipsophrenic's Avatar
    Computer Details
    skipsophrenic's Computer Details
    Operating System:
    Vista 32 bit
    Computer:
    Compaq
    Motherboard:
    erm . . yeah?
    CPU:
    Intel Pentium Dual CPU E2140 @ 1.60 Ghz
    RAM:
    2039MB
    Graphics:
    don't ask you'll kill me
    Primary Storage:
    360gb
    Monitor:
    21" widescren - 16:10 ratio
    Using
    AutoCAD 2008
    Join Date
    Jul 2008
    Location
    Birmingham, United Kingdom
    Posts
    1,020

    Default

    Lee Mac i'v not seen anythin like u're askin, but maybe if you tweaked atilla's code?......
    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein

    SET FILEDIA = 1

  10. #10
    Senior Member Attila The Gel's Avatar
    Computer Details
    Attila The Gel's Computer Details
    Operating System:
    Windows XP SP3
    Computer:
    Toshiba laptop
    Motherboard:
    ...
    CPU:
    ...
    RAM:
    ...
    Graphics:
    ...
    Primary Storage:
    ...
    Monitor:
    ...
    Using
    AutoCAD 2010
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    219

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by rkent View Post
    I found this old routine I use for changing layers by picking. I changed it to work transparently and it seems to work.
    So you load the file each time, through appload for example, and then after you have started the line command you can type 's "enter", pick a line on a layer you want to draw on and continue.

    (defun C:S (/ e n);set current layer by picking entity
    (setq e (car (entsel "Set Current Layer...\nPICK OBJECT: ")))
    (if e (progn
    (setq e (entget e))
    (setq n (cdr (assoc 8 e)))
    (command "'.LAYER" "SET" N "")
    ))
    )

    I've tried this code, but it doesn't seem to work? Its loads succesfully but when I start a line and type 's' and enter it doesn't ask to pick an object?
    The application is in the all loaded applications of appload but it is in a grey color. does this mean that it's not active?

    Quote Originally Posted by rkent View Post
    This simply changes to another layer that you select. The color should be set bylayer as well as linetype. Maybe we aren't understanding what you are really after.
    No no, we understand each other. Its just that I sometimes have 2 or 3 different linetypes/colors in one layer. thats why I was wondering if it also could copy the linetipe and color of the object I pick.

Similar Threads

  1. Lisp that will select layer and draw VP and go back to previous layer
    By matthewrussell in forum AutoLISP, Visual LISP & DCL
    Replies: 19
    Last Post: 20th Jan 2009, 09:21 pm
  2. By layer objects - change layer but keep colour?
    By Connect Project Tech in forum AutoCAD General
    Replies: 5
    Last Post: 9th Jan 2009, 05:49 pm
  3. Change Layer Prefixs and Layer Names
    By ML0940 in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 9th Jul 2008, 11:11 am
  4. Req: How to select all entities in a layer? [VBA]
    By theone in forum AutoLISP, Visual LISP & DCL
    Replies: 15
    Last Post: 7th Jul 2008, 09:42 am
  5. Change layer and return to layer using button
    By Vigilante in forum AutoCAD General
    Replies: 19
    Last Post: 6th Sep 2007, 07:01 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