Bhatch in Lisp
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Bhatch in Lisp

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
FrenkZA
Guest





Posted: Thu Dec 23, 2004 8:37 pm    Post subject: Bhatch in Lisp Reply with quote

After making a new layer i want the current layer back after the command Bhatch.
But in the dialogbox Bhatch i can only select one object.
or i can select "inherit properties"
Does anybody kwows, what i have done wrong???

Back to top
T.Willey
Guest





Posted: Fri Dec 24, 2004 12:03 am    Post subject: Re: Bhatch in Lisp Reply with quote

Why don't you just change the layer of the hatch after the command is finished?

Tim
Back to top
Dommy2Hotty
Guest





Posted: Fri Dec 24, 2004 12:59 am    Post subject: Re: Bhatch in Lisp Reply with quote

Have a look...

Code:
;;***********************************************
;;           Hatch_EL_Siding_4in.lsp            *
;;          Created by Dominic Cesare           *
;;             Dommy2Hotty@aol.com              *
;;                 02.27.04                     *
;;             Revised: 03.03.04                *
;;             Revised: 04.16.04                *
;;***********************************************

;;**********************
;;*  Start of Routine  *
;;**********************

;informs user how to run lisp
(prompt "\nType Hatch_Elevation_Siding_4in to run.....")

;define function
(defun c:Hatch_Elevation_Siding_4in ()
  (setq temperr *error*)
  (setq *error* trap1)
  ;getting current vars
  (setq oldlayer (getvar "clayer"))
  (setq oldecho (getvar "cmdecho"))
  (setq oldhpname (getvar "hpname"))
  (setq oldhpspace (getvar "hpspace"))
  (setq oldhpang (getvar "hpang"))
  ;turning off echo
  (setvar "cmdecho" 0)
  ;creating layer BRICK-EL
  (command "-layer" "m" "EL-HATCH-SIDING" "c" "251" "" "")
  ;setting hatch vars
  (setvar "hpname" "_user,_o")
  (setvar "hpspace" 4)
  (setvar "hpang" 0)
  ;inform user to change snapbase variable
  (prompt "\nSelect Origin for hatch or ENTER for no change.....")
  ;starting snapbase command
  (command "snapbase")
    (while (eq (logand (getvar "CmdActive") 1) 1)
    ; get user's input
    (command pause)
    ;_ closes while
    )
  ;inform user to select internal point for hatch
  (prompt "\nSelect Internal Point.....")
  ;starting hatch command
  (command "-bhatch")
  (while (eq (logand (getvar "CmdActive") 1) 1)
    ; get user's input
    (command pause)
    ;_ closes while
    )
  ;setting old vars
  (setvar "hpname" oldhpname)
  (setvar "hpspace" oldhpspace)
  (setvar "hpang" oldhpang)
  (setvar "clayer" oldlayer)
  (setvar "cmdecho" oldecho)
  (setq *error* temperr)
  (princ)
  )

(defun trap1 (errmsg)
  (command "u")
  (setvar "hpname" oldhpname)
  (setvar "hpspace" oldhpscale)
  (setvar "hpang" oldhpang)
  (setvar "clayer" oldlayer)
  (setvar "cmdecho" oldecho)
  (setq *error* temperr)
  (prompt "Resetting System Variables...")
  (princ)
  )

;;**********************
;;*  End of Routine    *
;;**********************


Back to top
FrenkZA
Guest





Posted: Fri Dec 24, 2004 3:28 pm    Post subject: Re: Bhatch in Lisp Reply with quote

Thanks very much,

the lines:

(while (eq (logand (getvar "CmdActive") 1) 1)
(command pause)

closed the bhatch command before i changed the layer
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB