Automating fontstyle dimstyle dimscale and ltscale.

Automating fontstyle dimstyle dimscale and ltscale.

LDShaw
Collaborator Collaborator
783 Views
1 Reply
Message 1 of 2

Automating fontstyle dimstyle dimscale and ltscale.

LDShaw
Collaborator
Collaborator

I have taken this routine as far as I can without help. What it should do is 

Bring in the font and dimstyles

Ask for the scale This is where the problem is I think.

Set the 
dimscale 

ltscale

fonts and dimension style.

All parts seem to work but when I run them together I get nothing. 

(defun c:setup3 ( / c store_temp dmscl sty1 ) 

;Binging in fontstyle if needed. 

	(command "-INSERT" "//dce/designdata/cadd/DC ACAD/DEFAULT/mech/dc notes/Text-Dim-Styles" "0,0" "1" "" "0")
	(command "erase" "l" "")
	

;Asking for scale.

(
 (setq store_temp dmscl)
  (prompt  "\nWhat is your scale? <")(if (/= nil) (progn(prin1 dmscl)))(prompt  ">:")
   (setq dmscl (getreal))
(if (= dmscl nil)(setq dmscl store_temp))
)

;SETTING DIMSCALE AND LTSCALE TO DETAIL SIZE

(setvar "dimscale" dmscl)
(setvar "ltscale" dmscl)

;settting fontstyles for scale. 

(if (= dmscl 1)
    (progn ; then
	(setq
	sty1 "dc"
	
	)
		(setvar "textstyle" sty1)
		(command "-dimstyle" "r" sty1)
	) ;progn
)

(if (= dmscl 12)
    (progn ; then
	(setq
	sty1 "dc-012"
	)
		(setvar "textstyle" sty1)
		(command "-dimstyle" "r" sty1)
	) ;progn
)

(if (= dmscl 24)
    (progn ; then
	(setq
	sty1 "dc-024"
	)
		(setvar "textstyle" sty1)
		(command "-dimstyle" "r" sty1)
	) ;progn
)
)


Any help would be appreciated. 

 

 

 

0 Likes
Accepted solutions (1)
784 Views
1 Reply
Reply (1)
Message 2 of 2

LDShaw
Collaborator
Collaborator
Accepted solution

I figured it out I think. Perhaps not the best but works now.

 

(defun c:setup3 ( / c store_temp dmscl sty1 ) 

;Binging in fontstyle if needed. 


	(command "-INSERT" "../../DEFAULT/mech/dc notes/Text-Dim-Styles" "0,0" "1" "" "0")
	(command "erase" "l" "")
;Asking for scale.
(setq store_temp dmscl)
	(prompt  "\nWhat is your scale? <")(if (/= nil) (progn(prin1 dmscl)))(prompt  ">:")
	(setq dmscl (getreal))
		(setq
		sty1 "dc"
		)
(setvar "dimscale" dmscl)
(setvar "ltscale" dmscl)
(if (= dmscl 1)
    (progn ; then
	(setq
	sty1 "dc"
	
	)
		(setvar "textstyle" sty1)
		(command "-dimstyle" "r" sty1)
) ;progn
)
)