Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hatch Lisp

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
182 Views, 11 Replies

Hatch Lisp

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
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: Anonymous

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.
Message 3 of 12
Anonymous
in reply to: Anonymous

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.
>
>
Message 4 of 12
Anonymous
in reply to: Anonymous

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)
> )
Message 5 of 12
Anonymous
in reply to: Anonymous

"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
Message 6 of 12
Anonymous
in reply to: Anonymous

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.
>
>
Message 7 of 12
Anonymous
in reply to: Anonymous



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
Message 8 of 12
Anonymous
in reply to: Anonymous

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*
|
Message 9 of 12
jrodriguez
in reply to: Anonymous

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
Message 10 of 12
t.willey
in reply to: Anonymous

Change this line
(command "_.-bhatch" "_p" "ANSI31" "12" "0")
to
(command "_.-bhatch" "_p" "ANSI31" "12" "0" "_a" "_a" "_n" "")

Tim
Message 11 of 12
jrodriguez
in reply to: Anonymous

AWESOME

thanks so much
Message 12 of 12
t.willey
in reply to: Anonymous

You're welcome.

Tim

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost