Linetype program not setting linetype to current

Linetype program not setting linetype to current

murmanator
Advocate Advocate
2,189 Views
20 Replies
Message 1 of 21

Linetype program not setting linetype to current

murmanator
Advocate
Advocate

Hi, I made this program that sets layer, color and linetype in order to draw a line. The linetype part is supposed to search for the type, load it if its not in the drawing, and set it to current. Everything seems to be working except for setting the linetype to current. It does load it just dosent set it. If I run the program with the linetype loaded it works fine. What am I missing? I have layer programs that are much like this and work like they should.

 

(DEFUN C:ITREE ()
	(GV)
	(command "-LAYER" "set" "RUNS" "" "" "")
	(command "-color" "YELLOW")
		(SETVAR 'CMDECHO 0)
		(if (= (assoc 0 (tblsearch "Ltype" "I_TREES")) nil)
			(vl-cmdf "-linetype" "l" "I_TREES" "" "" )
			(vl-cmdf "-linetype" "s" "I_TREES" "")
		)
	(command "_.pline" pause)
		(while (> (getvar "CMDACTIVE") 0) (command pause))
	(command "-linetype" "set" "Bylayer" "")
	(SV)
    (princ)
)

  

0 Likes
Accepted solutions (1)
2,190 Views
20 Replies
Replies (20)
Message 21 of 21

Kent1Cooper
Consultant
Consultant

@murmanator wrote:

... I am running an older version of CAD in 2013. ....


That would explain it.  I think [don't quote me] (command-s) didn't come in until 2014 or 2015.  You would need to use a version with the check on the CMDACTIVE System Variable.

Kent Cooper, AIA
0 Likes