How to make this work
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
How to make this work

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





Posted: Fri Jan 07, 2005 8:02 pm    Post subject: How to make this work Reply with quote

I have a macro to hatch stuff. It works. I want it to set a layer and then
reset the original layer when finished, but it bombs. The lisp reads the
DIMSCALE part correctly.

(DEFUN C:RHA ()
(SETQ DS (GETVAR "DIMSCALE"))
(SETQ CLAY (GETVAR "CLAYER"))
(COMMAND "._LAYER" "M" "HATCH-PVMT" "CO" "8" "" "")
(COMMAND "-BHATCH" "P" "DOTS" DS "E" "A" "I" "Y" "S" "N" "A" "Y" "")
;(COMMAND "LAYER" "SET" CLAY "")
(PRINC))

The line commented out is the culpret. How do I end the -BHATCH command
nicely so the layer command works?
--

Kevin R. Knox

Back to top
ecable
Guest





Posted: Fri Jan 07, 2005 8:07 pm    Post subject: Re: How to make this work Reply with quote

(setvar "clayer" clay)
Should work
Back to top
OLD-CADaver
Guest





Posted: Fri Jan 07, 2005 8:53 pm    Post subject: Re: How to make this work Reply with quote

<<(setvar "clayer" clay) Should work >>

So should his (command "layer" sequence. I suspect something's askew with the BHATCH line, like he's missing a response for hatch angle... or something.

What version of AutoCAD? R2002 requires a response for angle right after scale.

Back to top
GaryDF
Guest





Posted: Fri Jan 07, 2005 8:58 pm    Post subject: Re: How to make this work Reply with quote

Try this out...

error in your bhatch command.. you had E for angle?
setvar "clayer" clay...to return to previous layer
localized variables (/ ds clay)


(defun C:RHA (/ ds clay)
(setq DS (getvar "DIMSCALE") CLAY (getvar "CLAYER"))
(command ".-layer" "M" "HATCH-PVMT" "CO" "8" "" "")
(command ".-bhatch" "P" "DOTS" DS "" "A" "I" "Y" "S" "N" "A" "Y" "")
(while (> (getvar "cmdactive") 0)(command pause))
(command "")
(setvar "clayer" CLAY)
(princ)
)

Gary


"Kevin R. Knox" <kknox@hotmail.com> wrote in message news:41dea346_3@newsprd01...
Quote:
I have a macro to hatch stuff. It works. I want it to set a layer and then
reset the original layer when finished, but it bombs. The lisp reads the
DIMSCALE part correctly.

(DEFUN C:RHA ()
(SETQ DS (GETVAR "DIMSCALE"))
(SETQ CLAY (GETVAR "CLAYER"))
(COMMAND "._LAYER" "M" "HATCH-PVMT" "CO" "8" "" "")
(COMMAND "-BHATCH" "P" "DOTS" DS "E" "A" "I" "Y" "S" "N" "A" "Y" "")
;(COMMAND "LAYER" "SET" CLAY "")
(PRINC))

The line commented out is the culpret. How do I end the -BHATCH command
nicely so the layer command works?
--

Kevin R. Knox

Back to top
Kevin R. Knox
Guest





Posted: Fri Jan 07, 2005 9:55 pm    Post subject: Re: How to make this work Reply with quote

GaryDF,
Thanks... but
The layer HATCH-PVMT is created but the hatch ends up on CLAY not HATCH-PVMT
The E for angle = east to ACAD

How to get hatch on HATCH-PVMT layer and CLAY to be final layer?

~KRK~


"GaryDF" <fowler@architettura-inc.com> wrote in message
news:41deb247$1_3@newsprd01...
Quote:
Try this out...

error in your bhatch command.. you had E for angle?
setvar "clayer" clay...to return to previous layer
localized variables (/ ds clay)


(defun C:RHA (/ ds clay)
(setq DS (getvar "DIMSCALE") CLAY (getvar "CLAYER"))
(command ".-layer" "M" "HATCH-PVMT" "CO" "8" "" "")
(command ".-bhatch" "P" "DOTS" DS "" "A" "I" "Y" "S" "N" "A" "Y" "")
(while (> (getvar "cmdactive") 0)(command pause))
(command "")
(setvar "clayer" CLAY)
(princ)
)

Gary


"Kevin R. Knox" <kknox@hotmail.com> wrote in message
news:41dea346_3@newsprd01...
I have a macro to hatch stuff. It works. I want it to set a layer and
then
reset the original layer when finished, but it bombs. The lisp reads the
DIMSCALE part correctly.

(DEFUN C:RHA ()
(SETQ DS (GETVAR "DIMSCALE"))
(SETQ CLAY (GETVAR "CLAYER"))
(COMMAND "._LAYER" "M" "HATCH-PVMT" "CO" "8" "" "")
(COMMAND "-BHATCH" "P" "DOTS" DS "E" "A" "I" "Y" "S" "N" "A" "Y" "")
;(COMMAND "LAYER" "SET" CLAY "")
(PRINC))

The line commented out is the culpret. How do I end the -BHATCH command
nicely so the layer command works?
--

Kevin R. Knox



Back to top
GaryDF
Guest





Posted: Fri Jan 07, 2005 10:06 pm    Post subject: Re: How to make this work Reply with quote

Selected new hatch, is on Layer: "HATCH-PVMT"


Select objects:

HATCH Layer: "HATCH-PVMT"
Space: Model space
Handle = 9EB1
Hatch pattern DOTS
Hatch scale 48.00000000
Hatch angle 0.0000
Associative



hatched on new layer and previous layer returned.
works fine here...using autocad 2005 windows 2000

Gary


"Kevin R. Knox" <kknox@hotmail.com> wrote in message
news:41debdc5$1_1@newsprd01...
Quote:
GaryDF,
Thanks... but
The layer HATCH-PVMT is created but the hatch ends up on CLAY not HATCH-PVMT
The E for angle = east to ACAD

How to get hatch on HATCH-PVMT layer and CLAY to be final layer?

~KRK~


"GaryDF" <fowler@architettura-inc.com> wrote in message
news:41deb247$1_3@newsprd01...
Try this out...

error in your bhatch command.. you had E for angle?
setvar "clayer" clay...to return to previous layer
localized variables (/ ds clay)


(defun C:RHA (/ ds clay)
(setq DS (getvar "DIMSCALE") CLAY (getvar "CLAYER"))
(command ".-layer" "M" "HATCH-PVMT" "CO" "8" "" "")
(command ".-bhatch" "P" "DOTS" DS "" "A" "I" "Y" "S" "N" "A" "Y" "")
(while (> (getvar "cmdactive") 0)(command pause))
(command "")
(setvar "clayer" CLAY)
(princ)
)

Gary


"Kevin R. Knox" <kknox@hotmail.com> wrote in message
news:41dea346_3@newsprd01...
I have a macro to hatch stuff. It works. I want it to set a layer and
then
reset the original layer when finished, but it bombs. The lisp reads the
DIMSCALE part correctly.

(DEFUN C:RHA ()
(SETQ DS (GETVAR "DIMSCALE"))
(SETQ CLAY (GETVAR "CLAYER"))
(COMMAND "._LAYER" "M" "HATCH-PVMT" "CO" "8" "" "")
(COMMAND "-BHATCH" "P" "DOTS" DS "E" "A" "I" "Y" "S" "N" "A" "Y" "")
;(COMMAND "LAYER" "SET" CLAY "")
(PRINC))

The line commented out is the culpret. How do I end the -BHATCH command
nicely so the layer command works?
--

Kevin R. Knox





Back to top
ecable
Guest





Posted: Fri Jan 07, 2005 11:09 pm    Post subject: Re: How to make this work Reply with quote

Works in A2000i W2K
HATCH Layer: "HATCH-PVMT"
Space: Model space
Handle = 38C
Hatch pattern DOTS
Hatch scale 96.0000
Hatch angle 0
Associative
CLAY is current
Back to top
Kevin R. Knox
Guest





Posted: Sat Jan 08, 2005 7:09 am    Post subject: Re: How to make this work Reply with quote

I pasted all but the last ) works like a charm Thanks!


"ecable" <nospam@address.withheld> wrote in message
news:6795498.1105121395637.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
Works in A2000i W2K
HATCH Layer: "HATCH-PVMT"
Space: Model space
Handle = 38C
Hatch pattern DOTS
Hatch scale 96.0000
Hatch angle 0
Associative
CLAY is current
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
Contact Us
Powered by phpBB