Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Sullivan, Cory
Post 1 of 12

Hatch Lisp

73 Views, 11 Replies
06-04-2002 12:12 AM
Hi

I am looking for a simple lisp (I guess using -bhatch) that generates a
hatch with my pre-selected pattern, scale, rotation, etc.. Also I would
like it to place the hatch a specfic layer and then return to the current
active layer. I remeber seeing this sometime ago, but can't seem to find it
now.

Thanks


COry
*Turvill, Paul
Post 2 of 12

Re: Hatch Lisp

06-04-2002 12:24 AM in reply to: *Sullivan, Cory
Something like this should work (you'll need to gather the various
parameters with your own (getxxx) statements):

(setq clayer (getvar "clayer"))
(setvar "clayer" "<>")
(command "_.-bhatch" "_p" "<>" "<>" "<>")
(while (= (logand (getvar "cmdactive") 1) 1)
(command pause)
);; while
(setvar "clayer" clayer)
___

"Cory Sullivan" wrote in message
news:EE2DEE93ADD677E763CBCDA70E552444@in.WebX.maYIadrTaRb...
>
> I am looking for a simple lisp (I guess using -bhatch) that generates a
> hatch with my pre-selected pattern, scale, rotation, etc.. Also I would
> like it to place the hatch a specfic layer and then return to the current
> active layer. I remeber seeing this sometime ago, but can't seem to find
it
> now.
*Sullivan, Cory
Post 3 of 12

Re:

06-04-2002 12:58 AM in reply to: *Sullivan, Cory
Thanks Paul, but I am having trouble making it work, this is what I have.
(defun C:hatc ()
(setq scal (getvar "dimscale"))
(setq clayer (getvar "clayer"))
(setvar "clayer" "LINE Hatch")
(command "_.-bhatch" "_p" "ANSI31" (/ scal 2) "45")
(while (= (logand (getvar "cmdactive") 1) 1)
(command pause)
);; while
(setvar "clayer" clayer)
)

I have very limited lisp skills!!!

Thanks for any help




"Paul Turvill" wrote in message
news:A1F104E2F102A570109833D5DDCB3162@in.WebX.maYIadrTaRb...
> Something like this should work (you'll need to gather the various
> parameters with your own (getxxx) statements):
>
> (setq clayer (getvar "clayer"))
> (setvar "clayer" "<>")
> (command "_.-bhatch" "_p" "<>" "<>" "<>")
> (while (= (logand (getvar "cmdactive") 1) 1)
> (command pause)
> );; while
> (setvar "clayer" clayer)
> ___
>
> "Cory Sullivan" wrote in message
> news:EE2DEE93ADD677E763CBCDA70E552444@in.WebX.maYIadrTaRb...
> >
> > I am looking for a simple lisp (I guess using -bhatch) that generates a
> > hatch with my pre-selected pattern, scale, rotation, etc.. Also I would
> > like it to place the hatch a specfic layer and then return to the
current
> > active layer. I remeber seeing this sometime ago, but can't seem to
find
> it
> > now.
>
>
*Turvill, Paul
Post 4 of 12

Re:

06-04-2002 05:35 AM in reply to: *Sullivan, Cory
First, you can't have layer names containing spaces. Secondly, if the layer
doesn't already exist, then your routine will fail at the (setvar "clayer"
...) function.

(setvar "clayer" "LINE Hatch")
___

"Cory Sullivan" wrote in message
news:29DE00745600056439D9B1A990A8D7F7@in.WebX.maYIadrTaRb...
> Thanks Paul, but I am having trouble making it work, this is what I have.
> (defun C:hatc ()
> (setq scal (getvar "dimscale"))
> (setq clayer (getvar "clayer"))
> (setvar "clayer" "LINE Hatch")
> (command "_.-bhatch" "_p" "ANSI31" (/ scal 2) "45")
> (while (= (logand (getvar "cmdactive") 1) 1)
> (command pause)
> );; while
> (setvar "clayer" clayer)
> )
*Bell, R. Robert
Post 5 of 12

Re:

06-04-2002 06:00 AM in reply to: *Sullivan, Cory
"Paul Turvill" wrote in message
news:6F9911A9713994F72F7059FA92E9C217@in.WebX.maYIadrTaRb...
| First, you can't have layer names containing spaces.



Command: -layer
Current layer: "0"
Enter an option
[?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/Plot/Freeze/Thaw/LOck/Unlock/stAt
e]:
m
Enter name for new layer (becomes the current layer) <0>: LINE Hatch
Enter an option
[?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/Plot/Freeze/Thaw/LOck/Unlock/stAt
e]:
s
Enter layer name to make current or
*Turvill, Paul
Post 6 of 12

Re:

06-04-2002 11:12 AM in reply to: *Sullivan, Cory
Well ... you couldn't in R14, anyway ...
:-|
___

"R. Robert Bell" wrote in message
news:2DFD0EB11C1000FCC5CEEE63382EFC21@in.WebX.maYIadrTaRb...
>
> "Paul Turvill" wrote in message
> news:6F9911A9713994F72F7059FA92E9C217@in.WebX.maYIadrTaRb...
> | First, you can't have layer names containing spaces.
>
>
*Uhden, John
Post 7 of 12

Re:

06-04-2002 11:33 AM in reply to: *Sullivan, Cory


Command: (setvar "EXTNAMES" 0) 0
Command: (command ".layer" "M" "Line Hatch" "")

Invalid layer name.
*Cancel*

--
John Uhden, Cadlantic/formerly CADvantage
http://www.cadlantic.com
Sea Girt, NJ

"R. Robert Bell" wrote in message
news:2DFD0EB11C1000FCC5CEEE63382EFC21@in.WebX.maYIadrTaRb...
>
> "Paul Turvill" wrote in message
> news:6F9911A9713994F72F7059FA92E9C217@in.WebX.maYIadrTaRb...
> | First, you can't have layer names containing spaces.
>
>
>
> Command: -layer
> Current layer: "0"
> Enter an option
> [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/Plot/Freeze/Thaw/LOck/Unlock/stAt
> e]:
> m
> Enter name for new layer (becomes the current layer) <0>: LINE Hatch
> Enter an option
> [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/Plot/Freeze/Thaw/LOck/Unlock/stAt
> e]:
> s
> Enter layer name to make current or
*Bell, R. Robert
Post 8 of 12

Re:

06-04-2002 12:36 PM in reply to: *Sullivan, Cory
Well, sure, if you turn it off... ;-)

I was pleasantly surprised to see the (snvalid) honors the ExtNames setvar
though...

--
R. Robert Bell, MCSE
www.AcadX.com


"John Uhden" wrote in message
news:0AB7751573687E2D0C5688AAEDBB4A4D@in.WebX.maYIadrTaRb...
|
|
| Command: (setvar "EXTNAMES" 0) 0
| Command: (command ".layer" "M" "Line Hatch" "")
|
| Invalid layer name.
| *Cancel*
|
Valued Contributor
82 Posts
0 Kudos
Registered: ‎01-23-2004
Post 9 of 12

Re: Hatch Lisp

10-21-2004 11:44 AM in reply to: *Sullivan, Cory
Thanks Paul
I used that routine and its great... I have a question about Associative and non associative. I am wondering where in that code i could put a part that assigns the hatch to be non-associative?? i did a lil research through this site but didn't find what im looking for.. well maybe i did I just don't know where to place the code. below is what i found from other posts. but is there a way to put that in with your original code... heres what i got

;CUSTOM HATCH
(defun c:H1 ()
(setq clayer (getvar "clayer"))
(setvar "clayer" "HATCH")
(command "_.-bhatch" "_p" "ANSI31" "12" "0")
(while (= (logand (getvar "cmdactive") 1) 1)
(command pause)
);; while
(setvar "clayer" clayer)
)


heres the command i found from another post.


^C^C-HATCHEDIT;\D; is a simple menu macro that will change an Associative
Hatch into a Non-Associative one - one at a time.

thanks in advance for any help,
JRodriguez
Mentor
2,504 Posts
3 Kudos
Registered: ‎02-17-2004
Post 10 of 12

Re: Hatch Lisp

10-21-2004 11:54 AM in reply to: *Sullivan, Cory
Change this line
(command "_.-bhatch" "_p" "ANSI31" "12" "0")
to
(command "_.-bhatch" "_p" "ANSI31" "12" "0" "_a" "_a" "_n" "")

Tim
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!