+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
  1. #1
    Senior Member
    Using
    AutoCAD 2011
    Join Date
    Jan 2014
    Posts
    169

    Default Layers draw order ; first last

    Registered forum members do not see this ad.

    hi
    I have several drawings based on hatches and some lines.
    I always want the hatch layer to appear last, in the very background, then line 1 second last, line 2 3rd last, and so on... based on layer ( i think)

    is there a way to set and lock the priority of layers, in this manner?

  2. #2
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,579

    Default

    This may help and does not use draw order, assign an elevation to each layer in the order required I have found this to work as a simple method.

    I have something I do all the time and it has 4 draworders but I just know the order to make it work.
    A man who never made mistakes never made anything

  3. #3
    Super Moderator Cad64's Avatar
    Computer Details
    Cad64's Computer Details
    Operating System:
    Windows 7 Profesional x64
    Computer:
    XI Computers
    Motherboard:
    Asus P8Z77-V Pro
    CPU:
    Intel Core I7 3770K 4.1 Ghz Quad Core 3rd Gen
    RAM:
    24GB DDR3 @ 1333MHz
    Graphics:
    Nvidia GeForce GTX 570 1280MB GDDR5
    Primary Storage:
    SATAII 500GB 7200 RPM
    Secondary Storage:
    Western Digital My Book Studio Edition II - 2TB capacity
    Monitor:
    HPf2105 21" LCD Widescreen & Cintiq 21ux
    Discipline
    Multi-disciplinary
    Cad64's Discipline Details
    Occupation
    Freelance Digital Artist
    Discipline
    Multi-disciplinary
    Details
    3D model building, texturing and rendering. Photoshop Color Graphics.
    Using
    AutoCAD 2014
    Join Date
    Feb 2006
    Location
    San Antonio, TX
    Posts
    10,312

    Default

    I just did a quick search and found the lisp routine below. Just edit the code to set your layer order as you want it, then load and run the routine.

    Code:
    ;;; OrderByLayer.lsp
    ;;; By 3wood 2015.12.24
    ;;; Change the layer name and add more layers to suit.
    ;;; The first layer will be sent to front and the last layer sent to back.
    (defun C:OrderByLayer ()
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer1"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer2"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer3"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer4"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer5"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer6"))) "" "_B")
      )
    CGSociety Portfolio: http://rdeweese.cgsociety.org/
    Facebook:
    https://www.facebook.com/rdeweese67/


    "Work Smart, Not Hard"

  4. #4
    Senior Member
    Using
    AutoCAD 2011
    Join Date
    Jan 2014
    Posts
    169

    Default

    Quote Originally Posted by Cad64 View Post
    I just did a quick search and found the lisp routine below. Just edit the code to set your layer order as you want it, then load and run the routine.

    Code:
    ;;; OrderByLayer.lsp
    ;;; By 3wood 2015.12.24
    ;;; Change the layer name and add more layers to suit.
    ;;; The first layer will be sent to front and the last layer sent to back.
    (defun C:OrderByLayer ()
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer1"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer2"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer3"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer4"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer5"))) "" "_B")
      (command "._DRAWORDER" (ssget "_A" '((8 . "Layer6"))) "" "_B")
      )
    thanks Cad64, so how to use it... i only understand that i should replace " Layer1" with my named layer, but what is ssget"_A" and ((8. ? what do i do with A and 8? is it possible to have an example with 2 layers?

  5. #5
    Senior Member
    Using
    AutoCAD 2011
    Join Date
    Jan 2014
    Posts
    169

    Default

    Quote Originally Posted by BIGAL View Post
    This may help and does not use draw order, assign an elevation to each layer in the order required I have found this to work as a simple method.

    I have something I do all the time and it has 4 draworders but I just know the order to make it work.
    I went to layer property of the hatch and assigned elevation -1 . all the other layer's properties have elevation 0, so this should keep that hatch layer always behind, correct?
    But after saving the DWG and re opening it, the hatch wasn't in the back ... so i guess something is not right
    Last edited by cat3appr; 28th Feb 2018 at 01:01 pm.

  6. #6
    Senior Member
    Using
    AutoCAD 2011
    Join Date
    Jan 2014
    Posts
    169

    Default

    ok i've attached the drawing i'm working on.

    If you open the layers, HATCH layer should always be in the back, and is not, even after assigning a negative elevation.

    Layers: Overage and Overage+5 should be on top layer Hatch but below AS-Laid Pipeline Line...

    How to do this in an automatic way?
    Attached Files

  7. #7
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2018
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    12,094

    Default

    Opens correctly here in AutoCAD 2018, I tried in AutoCAD 2011, but it said drawing was created in newer version, I converted it back to 2010 and got that it had 8 errors and needed recovered, it then opened correctly in AutoCAD 2011. What Version of AutoCAD are you using?

    Could it be your graphics card or driver?

    Error when opening.
    Attached Images
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  8. #8
    Super Moderator Cad64's Avatar
    Computer Details
    Cad64's Computer Details
    Operating System:
    Windows 7 Profesional x64
    Computer:
    XI Computers
    Motherboard:
    Asus P8Z77-V Pro
    CPU:
    Intel Core I7 3770K 4.1 Ghz Quad Core 3rd Gen
    RAM:
    24GB DDR3 @ 1333MHz
    Graphics:
    Nvidia GeForce GTX 570 1280MB GDDR5
    Primary Storage:
    SATAII 500GB 7200 RPM
    Secondary Storage:
    Western Digital My Book Studio Edition II - 2TB capacity
    Monitor:
    HPf2105 21" LCD Widescreen & Cintiq 21ux
    Discipline
    Multi-disciplinary
    Cad64's Discipline Details
    Occupation
    Freelance Digital Artist
    Discipline
    Multi-disciplinary
    Details
    3D model building, texturing and rendering. Photoshop Color Graphics.
    Using
    AutoCAD 2014
    Join Date
    Feb 2006
    Location
    San Antonio, TX
    Posts
    10,312

    Default

    Quote Originally Posted by cat3appr View Post
    thanks Cad64, so how to use it... i only understand that i should replace " Layer1" with my named layer, but what is ssget"_A" and ((8. ? what do i do with A and 8? is it possible to have an example with 2 layers?
    The only things you have to edit in the code are the layer names. Everything else stays the same. You said you want your hatch layer at the very back, so that layer name should be at the bottom of the list, then arrange your other layers in the order you want them to display above the hatch layer. See below.

    Code:
    ;;; OrderByLayer.lsp 
    ;;; By 3wood 2015.12.24 
    ;;; Change the layer name and add more layers to suit. 
    ;;; The first layer will be sent to front and the last layer sent to back. 
    (defun C:OrderByLayer ()   
    (command "._DRAWORDER" (ssget "_A" '((8 . "Top_Layer"))) "" "_B")   
    (command "._DRAWORDER" (ssget "_A" '((8 . "Middle_Layer"))) "" "_B")   
    (command "._DRAWORDER" (ssget "_A" '((8 . "Hatch_Layer"))) "" "_B")
    )
    CGSociety Portfolio: http://rdeweese.cgsociety.org/
    Facebook:
    https://www.facebook.com/rdeweese67/


    "Work Smart, Not Hard"

  9. #9
    Senior Member
    Using
    AutoCAD 2011
    Join Date
    Jan 2014
    Posts
    169

    Default

    Quote Originally Posted by SLW210 View Post
    Opens correctly here in AutoCAD 2018, I tried in AutoCAD 2011, but it said drawing was created in newer version, I converted it back to 2010 and got that it had 8 errors and needed recovered, it then opened correctly in AutoCAD 2011. What Version of AutoCAD are you using?

    Could it be your graphics card or driver?

    Error when opening.
    Thanks SLW, I use CAD MAP 2015, what sort of mistakes did you get?
    Graphic card is fine, it's fine, it can be anything else then.. windows, heating system etc.. I just need to organize some layers, if it can be easily done, ok, or else i just leave them as they are

  10. #10
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2018
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    12,094

    Default

    Registered forum members do not see this ad.

    Displays in correct order here in AutoCAD. Maybe it's a MAP issue. You need to update your profile or include what you are using in your question.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



Similar Threads

  1. Alter draw order of selection set on different layers
    By cletero in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 31st Aug 2014, 08:17 pm
  2. Draw Order
    By Squirltech in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 3
    Last Post: 13th Oct 2010, 06:27 pm
  3. Draw Order?
    By criehle in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 17th Mar 2009, 08:16 am
  4. Draw Order
    By lenback in forum AutoCAD General
    Replies: 1
    Last Post: 21st Nov 2008, 02:35 pm
  5. Draw order
    By johnengineer in forum AutoCAD Beginners' Area
    Replies: 7
    Last Post: 3rd Aug 2007, 09:21 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