CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
Czech English Deutsch
Login/Register:
 Visitors: 3864 
RSS tips RSS channel - CAD tips
RSS discussion RSS channel - CAD discussion

Discussion Discussion forum

HelpCAD discussion

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

The information that you provide in this form will make up your forum profile which can be viewed by other forum members. Your email address will only be visible by forum admin and moderators and will be used to send you Forum Notifications. To cancel your account, use the page Opt-out or contact webmaster@cadforum.cz.

Topic Closedtext below the dim line

 Post Reply Post Reply
Author
JohnH79 View Drop Down
Newbie
Newbie


Joined: 19.Nov.2013
Location: Canada
Using: mechanical 2009
Status: Offline
Points: 5
Direct Link To This Post Topic: text below the dim line
    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
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7087
Direct Link To This Post 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>>

Back to Top
JohnH79 View Drop Down
Newbie
Newbie


Joined: 19.Nov.2013
Location: Canada
Using: mechanical 2009
Status: Offline
Points: 5
Direct Link To This Post 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
Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2019
Status: Offline
Points: 530
Direct Link To This Post 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")
Back to Top
JohnH79 View Drop Down
Newbie
Newbie


Joined: 19.Nov.2013
Location: Canada
Using: mechanical 2009
Status: Offline
Points: 5
Direct Link To This Post 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
Back to Top
JohnH79 View Drop Down
Newbie
Newbie


Joined: 19.Nov.2013
Location: Canada
Using: mechanical 2009
Status: Offline
Points: 5
Direct Link To This Post Posted: 19.Nov.2013 at 20:39
I got it...I found another routine.  been searching for weeks and finally found one.
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,047 seconds.