andr3flaviano Posted September 30, 2016 Share Posted September 30, 2016 Hello, Guys! I need a litte help in a very easy question about Lisp I need a Lisp for insert a especific text at a especific point in autocad... Example: I want to write the number 5 at the point: x = 3 y = 2 It's easy, but i don't now how to input the coordinates of the text Could Someone help me, please?? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 1, 2016 Share Posted October 1, 2016 Easy ; based on some form of values being obtained. (setq x 3) (setq y 2) (setq ans "5") (command "Text" (list x y) 0.25 0 ans) Quote Link to comment Share on other sites More sharing options...
lrm Posted October 1, 2016 Share Posted October 1, 2016 Bigal, your program will work if the default text height is 0.0 but will place the text "0" if the text height is > 0.0. The text command has one less prompt if the default text height is not 0.0. Is there a way to check for the default text height. ~Lee Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 2, 2016 Share Posted October 2, 2016 Lrm you are correct there are two methods to Text one with a preset height the other with height=0.0 There is a couple of ways around this. Its always difficult when posting example code to do with text to know which way to post. As a generic approach at work we set the text style to a preset style in our dwt then we know if height is 0.0 or not. ; example of checking current text style has a preset height. (setq ts (cdr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE"))))) (if (zerop ts) (command "TEXT" "498,18" "3.5" "0" ans) (command "TEXT" "498,18" "0" ans) ) Quote Link to comment Share on other sites More sharing options...
lrm Posted October 2, 2016 Share Posted October 2, 2016 Thanks BIGAL, this is something that has stymied me for a long time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.