use draworder on edata?

Discussion in 'AutoCAD' started by C Witt, Jun 29, 2004.

  1. C Witt

    C Witt Guest

    I have a lisp that makes hatch to suit our standards.. but I need a way
    of sending it to back. Now near as i can tell "draworder" won't work on
    selection sets.. or enames.. so how can i send the hatch to back once
    made? (keep in mind that I may need to make 3-4 hatches at once, so a
    "previous" or "last" option proly won't work).

    TIA guys/gals.
     
    C Witt, Jun 29, 2004
    #1
  2. C Witt

    randy benson Guest

    It works on selection sets; you can adapt this to your needs (use the
    attachment or beware of word-wrap):

    ;*** HatchOrder - sends hatches to far back, etc.

    (defun c:ho ( / ss)
    (setvar "REGENMODE" 0)
    ; (setvar "qaflags" 135)
    ; (setvar "nomutt" 1)
    (if
    (and (setq ss (ssget "x" '((0 . "INSERT")(8 . "TREE,HORT")))))
    (command "._DRAWORDER" ss "" "BACK") ; Send trees 3rd
    furthest back
    )
    (if
    (and (setq ss (ssget "x" '((8 . "*CONT-*"))))) ; Send contours 2nd
    furthest back
    (command "._DRAWORDER" ss "" "BACK")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "HATCH"))))) ; Send hatches
    furthest back
    (command "._DRAWORDER" ss "" "BACK")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "INSERT")(2 . "PP"))))) ; 4th
    farthest front
    (command "._DRAWORDER" ss "" "FRONT")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "TEXT"))))) ; 3rd
    farthest front
    (command "._DRAWORDER" ss "" "FRONT")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "INSERT")(2 . "*PTBLK"))))) ; 2nd
    farthest front
    (command "._DRAWORDER" ss "" "FRONT")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "IMAGE"))))) ; farthest front
    (progn
    (command "IMAGEFRAME" "ON")
    (command "._DRAWORDER" ss "" "FRONT")
    (command "IMAGEFRAME" "OFF")
    )
    )
    (setvar "REGENMODE" 1)
    (princ "DrawOrder for hatches, contours, tree & hort symbols, text &
    ptblks sorted. ")
    ; (setvar "qaflags" 0)
    ; (setvar "nomutt" 0)
    (princ)


    ;*** HatchOrder - sends hatches to far back, etc.

    (defun c:ho ( / ss)
    (setvar "REGENMODE" 0)
    ; (setvar "qaflags" 135)
    ; (setvar "nomutt" 1)
    (if
    (and (setq ss (ssget "x" '((0 . "INSERT")(8 . "TREE,HORT")))))
    (command "._DRAWORDER" ss "" "BACK") ; Send trees 3rd furthest back
    )
    (if
    (and (setq ss (ssget "x" '((8 . "*CONT-*"))))) ; Send contours 2nd furthest back
    (command "._DRAWORDER" ss "" "BACK")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "HATCH"))))) ; Send hatches furthest back
    (command "._DRAWORDER" ss "" "BACK")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "INSERT")(2 . "PP"))))) ; 4th farthest front
    (command "._DRAWORDER" ss "" "FRONT")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "TEXT"))))) ; 3rd farthest front
    (command "._DRAWORDER" ss "" "FRONT")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "INSERT")(2 . "*PTBLK"))))) ; 2nd farthest front
    (command "._DRAWORDER" ss "" "FRONT")
    )
    (if
    (and (setq ss (ssget "x" '((0 . "IMAGE"))))) ; farthest front
    (progn
    (command "IMAGEFRAME" "ON")
    (command "._DRAWORDER" ss "" "FRONT")
    (command "IMAGEFRAME" "OFF")
    )
    )
    (setvar "REGENMODE" 1)
    (princ "DrawOrder for hatches, contours, tree & hort symbols, text & ptblks sorted. ")
    ; (setvar "qaflags" 0)
    ; (setvar "nomutt" 0)
    (princ)
    )
     
    randy benson, Jun 29, 2004
    #2
  3. Why not use the "DRaworder" option within
    the hatch command?
     
    Jason Piercey, Jun 29, 2004
    #3
  4. C Witt

    C Witt Guest

    because i'm not using the hatch command..
     
    C Witt, Jun 29, 2004
    #4
  5. C Witt

    C Witt Guest

    thank you will give it a try. (btw i could never get draworder to work
    like that so not sure why it works for you) but i shal try yours.
     
    C Witt, Jun 29, 2004
    #5
  6. Pardon the assumption.
     
    Jason Piercey, Jun 29, 2004
    #6
  7. C Witt

    C Witt Guest

    np, i didn't specify that in my post.
     
    C Witt, Jun 29, 2004
    #7
  8. C Witt

    C Witt Guest

    thank you again, works great.

     
    C Witt, Jun 29, 2004
    #8
  9. C Witt

    randy benson Guest

    Glad to help; it helped me too -- I realized I had the 'front' orders
    partially reversed from what I intended.
     
    randy benson, Jun 29, 2004
    #9
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.