I wanna make a hatchback command

Discussion in 'AutoCAD' started by archotect, Jan 22, 2004.

  1. archotect

    archotect Guest

    I would like to make a hatch back command. this function simply puts all hatches to the back of the drawing.

    i was looking at the draw order command, but this requires selection of ojects before invoking the command. is there a way to create selection based on wild card criteria (suck as *hatch), then invoke the draworder, then back?

    the later part is easy i just have to put the following in a lsp routine: (defun c:vb () (command "draworder" "b")), its the pre-selection i am having trouble with.

    tia.
     
    archotect, Jan 22, 2004
    #1
  2. archotect

    XPLODE Guest

    Try this macro (button). It is not a lisp but works pretty good. Your hatch layers need to begin with"hatch" for it to get them all. The tilemode commands can come out but then it will not work while in paperspace. (On modelspace entities.)

    ^C^Ctilemode;1;ssx;;la;hatch*;;dr;p;;b;tilemode;0;regenall;
     
    XPLODE, Jan 22, 2004
    #2
  3. A similar Progam to Jeff's, using only on Current TAB

    (DeFun C:HBack ( / #PiHat)
    (PrompT "(C:HBack) Hatch Back")
    (If
    (SetQ #PiHat (SSGet "X" (List(Cons 0 "Hatch")(Cons 410 (GetVar
    "CTab")))))
    (VL-Cmdf "DrawOrder" #PiHat "" "B")
    (Alert "There Are NO Hatch on Current TAB")
    );If
    (PrinC)
    );DeFun


    all hatches to the back of the drawing.
    ojects before invoking the command. is there a way to create selection
    based on wild card criteria (suck as *hatch), then invoke the draworder,
    then back?
    routine: (defun c:vb () (command "draworder" "b")), its the pre-selection i
    am having trouble with.
     
    Jesús Padilla, Jan 22, 2004
    #3
  4. archotect

    Josh Guest

    (setq hatch (ssget "x" '((0 . "hatch"))))
    (command "draworder" hatch "b")


    hatches to the back of the drawing.
    ojects before invoking the command. is there a way to create selection
    based on wild card criteria (suck as *hatch), then invoke the draworder,
    then back?
    (defun c:vb () (command "draworder" "b")), its the pre-selection i am having
    trouble with.
     
    Josh, Jan 22, 2004
    #4
  5. archotect

    Jeff Mishler Guest

    Jesús,
    Technically mine only work on the current tab, also. When you get the
    selection set with (ssget "x"), it may select everything, but if you pass
    that ss to a (command) call, all entities in the ss that are not in the
    current tab get filtered out. However, the routine will bomb out if there
    are hatches in other tabs but none are in the current tab.

    Jeff
     
    Jeff Mishler, Jan 22, 2004
    #5
  6. Jeff

    Generally I use many tabs, that's why I did it.

    I have a cuestion:

    Draworder only works on the current drawing, when it is XReferenced, then
    entities are bad ordered.

    ¿is there a way on AutoCAD to solve the problem?

    Jesús
     
    Jesús Padilla, Jan 22, 2004
    #6
  7. archotect

    Jeff Mishler Guest

    The only way I know is to reverse the draworder in the xref file prior to
    xrefing, but then that messes up the base drawing. So no, there is no "good"
    way. ;-(

    Jeff
     
    Jeff Mishler, Jan 22, 2004
    #7
  8. Jeff:

    I Have a function to order the display

    I would like to know your comments about.

    I'm architect, not programmer, so I have invester many hours on it.

    I will put it on another theme.

    JPadilla
     
    Jesús Padilla, Jan 22, 2004
    #8
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.