Print Page | Close Window

text below the dim line

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=9819
Printed Date: 17.May.2026 at 03:59


Topic: text below the dim line
Posted By: JohnH79
Subject: text below the dim line
Date Posted: 19.Nov.2013 at 16:02

I know how to add text below the dim line the manual way.  However, I am trying to put it into a toolbar button.

When I put the command (\X) into my button settings, CAD is reading the backslash first (\), which is the command "wait for users input" and it wont go any further.
 
Hopefully this makes sense.  Can anyone help me?
 
John



Replies:
Posted By: John Connor
Date Posted: 19.Nov.2013 at 18:42
Have you tried reversing the slash?


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: JohnH79
Date Posted: 19.Nov.2013 at 19:07
I tried that before and it didn't work.  I just did it now, it just shows exactly what I have typed "/XEFS"  I have also tried "<>\\XEFS"  double backslash...but that just then waits for two user inputs.  I even tried putting in a space after "<> EFS" but then I get an error from CAD "unknown command:EFS"
 
I really am at a loss.  The biggest issue is the backslash...if I can get around the backslash that will work or if I can get CAD to take \X as a whole command rather than seeing \ then X, that would really fix my problem


Posted By: Kent Cooper
Date Posted: 19.Nov.2013 at 19:41

You can have AutoLISP expressions in macros.  I haven't tried this, but maybe you could embed the backslash inside a (strcat) function even if you're not concatenating more than one string together, just to get it inside a stretch of code that will be interpreted by Lisp, which should prevent the macro interpreter from reading it as a pause.  [I believe it would need to be represented by a double backslash.]

(strcat "<>\\XEFS")


Posted By: JohnH79
Date Posted: 19.Nov.2013 at 20:06
HERE IS THE LISP ROUTINE THAT I FOUND ON ANOTHER CAD FORUM. 

 

(defun c:DTOR () (c:DimTextOverride))
(defun c:DimTextOverride ( / ss textString)
(princ "\rDIMENSION TEXT OVERRIDE ")
(vl-load-com)
(if (and (setq ss (ssget '((0 . "DIMENSION"))))
(setq textString
(getstring
T
"\nEnter override text, <Enter> to remove override: ")))
(progn
(vla-startundomark
(cond (*activeDoc*)
((setq *activeDoc*
(vla-get-activedocument
(vlax-get-acad-object))))))
(vlax-for oDim
(setq ss (vla-get-activeselectionset *activeDoc*))
(vla-put-textoverride oDim textString))
(vla-delete ss)
(vla-endundomark *activeDoc*))
(prompt "\n** Nothing selected ** "))
(princ))

it works exactly what I want it to do.  I select the dimension line and then manually type in "<>\XEFS" and it gives me EXACTLY what Im looking for.  I am trying to improve it by having it add that text by itself.  I tried combine both this LISP routine with a button but the darn backslash is getting in the way.  I tried to add  "<>\XEFS" to the lips routine but it just isn't seeing it.  The biggest issue is that I have never written LISP routines before, so it looks French to me..I understand some of it but not all of it..LOL


Posted By: JohnH79
Date Posted: 19.Nov.2013 at 20:39
I got it...I found another routine.  been searching for weeks and finally found one.



Print Page | Close Window