Dim twoline text \X by default

Dim twoline text \X by default

Clay_Stringer
Enthusiast Enthusiast
593 Views
2 Replies
Message 1 of 3

Dim twoline text \X by default

Clay_Stringer
Enthusiast
Enthusiast

When adding a second line of text to a dimension, autocad automatically uses the \P coding.  You can replace this with \X in the text override properties and the second line will be below the dim line.  

 

Is there a way to force autocad to use the \X method by default?

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

hak_vz
Advisor
Advisor
Accepted solution

@Clay_Stringer 

 

Try this.

 

After you have all you dimension object set use function "secondLineUnder" to place second text line under dimension line.

 

 

(defun C:secondLineUnder ( / *error* adoc ss i ent text)
	(defun *error* ( msg )
		(if (not (member msg '("Function cancelled" "quit / exit abort")))
			(princ (strcat "\nError: " msg))
		)
		(if adoc (vla-endundomark adoc))
		(setvar 'cmdecho 1)
		(setvar 'menuecho 1)
		(princ)
	)
	 
	(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
	(vla-endundomark adoc)
	(vla-startundomark adoc)	
	(princ "\nSelect dimension objects to put second text line unde dimension line >")
	(setq ss (ssget '((0 . "DIMENSION"))))
	(cond
		((and ss)
			(setq i -1)
			(while (< (setq i (1+ i)) (sslength ss))
			(setq ent (entget (ssname ss i)) text (cdr (assoc 1 ent)))
				(cond 
					((> (vl-string-position (ascii "\\") text) 1)
						(setq text(vl-string-subst "\X" "\P" text))
						(setq ent (subst (cons 1 text)(assoc 1 ent) ent))
						(entmod ent)
					)
				)
			)
		)
	)
	(vla-endundomark adoc)
	(princ)
)

 

 


@Clay_Stringer wrote:

Is there a way to force autocad to use the \X method by default?


Probably not because it would then affect all dimension objects (that's why this is an override - a special case).

This is not an option to set in dimension style.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 3

Clay_Stringer
Enthusiast
Enthusiast

This works well, after the fact.  But I'd still like a way, if possible, where just hitting enter creates a new line below by default.  I've scoured the variables and I can't find one.

0 Likes