change linetypes in routine

change linetypes in routine

Draftsman13
Contributor Contributor
838 Views
2 Replies
Message 1 of 3

change linetypes in routine

Draftsman13
Contributor
Contributor

I was wondering if someone has had this problem?  I have a lisp routine for inputing a hatch with the lines at a specific distance apart.  It was written on ACAD 2004 and obviously worked as it should have.  We have upgraded to ACAD 2016 and the routine still works, but instead of putting the hatch lines on the layers designated linetype, it is installing it on the CONTINUOUS linetype.  Does anybody know how I can change this setting?  I have included the code below, minus the error code.

 

(setq oldos (getvar "osmode")) ; saves the current osnap settings
(setvar "osmode" 191) ; sets new osnap settings
(setq oldor (getvar "orthomode")) ; saves the current ortho setting
(setvar "orthomode" 1) ; turns the ortho on
(setq oldlayer (getvar "clayer")) ; saves the current layer
(command "_.-layer" "_make" "RAFTERS" "_color" "3"
"" "_ltype" "phantom" "" "") ; updates the layer settings if newly created

(setq p1 (getpoint "\nSelect rafter starting point: ")) ; asks user to select the point for the p1 variable

(setq p2 (getpoint p1 "\nDirection rafters to run:")) ; asks user to select the direction of the rafters

(setq space ; sets the 'space' variable
(cond
((getdist ; asks user for input; if they hit Enter, returns nil, so it goes
(strcat ; to next test
"\nSpacing of Rafters <24>: " ; if there's a value set, offer it as default; if not, offer 24
) ; end strcat [prompt]
)) ; end getdist and first test; entered number gets saved to 'space'
; if they enter one
(T (if space space 24)) ; if they hit Enter above for the default, and there's a value set,
; use it, otherwise use 24
) ; end cond
) ; end setq

(command "_.-bhatch" "s" (ssget) "" "p" "user"
p1 p2 space "no" "o" "s" p1 "y" "") ; start the hatch

(setq ha (entlast)) ; ties the hatch to the 'ha' variable
(command "_.explode" ha) ; explodes the hatch

(setvar "osmode" oldos) ; sets the osnaps to previous settings
(setvar "orthomode" oldor) ; restores the ortho to previous setting
(setvar "clayer" oldlayer) ; sets the current layer to previous setting

0 Likes
Accepted solutions (1)
839 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

HPLINETYPE On

 

or

 

(setvar 'hplinetype 1)

Kent Cooper, AIA
Message 3 of 3

Draftsman13
Contributor
Contributor

thank you!

0 Likes