Hatch fonction in lisp

Discussion in 'AutoCAD' started by MarcelGoulet, Feb 2, 2004.

  1. MarcelGoulet

    MarcelGoulet Guest

    Hi,

    I'm doing a program with some hatch, but a weard problem always happen. The problem is when I need to choose Pick or Select in the selection options.

    If I choose Pick to make my selection, all the lisp expression following that hatch command is not read by the program ?

    If I choose Select, everything is ok.

    Is there something special I need to do when I choose the Pick option ?

    Thanks
     
    MarcelGoulet, Feb 2, 2004
    #1
  2. MarcelGoulet

    JP Remacle Guest

    MarcelGoulet a exprimé avec précision :
    Hi.
    Look my code.
    I have the choice.
    By default I Click.
    If [Enter] is pressed, i select my object.

    ---------
    (DEFUN c:hwall (/ -pp-)

    (SETVAR "cmdecho" 0) ;desactive l'affichage des opérations
    (SETQ anc_osmode (GETVAR "osmode"))
    (SETQ anc_layer (GETVAR "clayer"))
    (SETVAR "osmode" 0)
    (COMMAND "_.layer" "_make" "trame" "_C" "254" "" "")
    (COMMAND "_color" "12")
    (SETVAR "hpname" "ansi31")
    (SETVAR "hpang" (/ PI 2))
    (SETVAR "hpscale" 20)

    (SETQ
    -pp-
    (GETPOINT
    "\nCliquez l'endroit à hachurer: [Enter] Pour sélection
    manuelle." ;;; Here I Clik
    ) ;_ Fin de GETPOINT
    ) ;_ Fin de SETQ
    (IF (= -pp- nil) ;;;; [ENTER] is pressed
    (PROGN
    (PRINC "\nSelection des Objects à hachurer.")
    (COMMAND "_select" pause)
    (COMMAND "-bhatch" "_s" "_P" "" "")
    ) ;_ Fin de progn
    ) ;_ Fin de if
    (WHILE (/= -pp- nil)
    (PROGN
    (COMMAND "-bhatch" -pp- "")
    (SETQ
    -pp-
    (GETPOINT
    "\nCliquez l'endroit à hachurer: "
    ) ;_ Fin de GETPOINT
    ) ;_ Fin de SETQ
    ) ;_ Fin de progn
    ;; fin du progn
    ) ;_ Fin de while
    ;; fin du while
    ;;; (COMMAND "_.layer" "_set" "0" "")
    (SETVAR "clayer" anc_layer)
    (COMMAND "_color" "_bylayer")
    (SETVAR "osmode" anc_osmode)
    (SETVAR "cmdecho" 1)
    (PRINC)
    ) ;_ Fin de defun

    (DEFUN c:hw ()
    (c:hwall)
    ) ;_ Fin de defun

    (PRINC "\nProgram Hatch Wall loaded. Star with HWall or HW. \n")
    (PRINC)
     
    JP Remacle, Feb 2, 2004
    #2
  3. MarcelGoulet

    MarcelGoulet Guest

    The following expression that are after the hatch command are read, but they are read before the command hatch end.

    So if the drawing is on layer zero and :
    1. I create the layer HATCH
    2. I make it current.
    3. I create the hatch
    4. I put back the original layer current.

    The layer is created but the hatch will be on layer zero because the program read de line 4 before ending the hatch
     
    MarcelGoulet, Feb 2, 2004
    #3
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.