Display full version of the post: text below the dim line

JohnH79
19.11.2013, 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

John Connor
19.11.2013, 18:42
Have you tried reversing the slash?

JohnH79
19.11.2013, 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

Kent Cooper
19.11.2013, 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")

JohnH79
19.11.2013, 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(getstringT"\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

JohnH79
19.11.2013, 20:39

I got it...I found another routine.  been searching for weeks and finally found one.