DDJL Posted April 28, 2020 Posted April 28, 2020 I'm trying to learn Autolisp. I using Reinaldo N. Togores book "AutoCAD expert's Visual LISP". One of his lisp programs, is a Function called "Draw-Text"; which asks for a insertion point, then places text and that point. I can't get it to work. Textstyle should be set to "Standard" Here is the code: ;;;Generic text-drawing function. (defun draw-text (pt-ins height numbering / old-osm) (setq old-osm (getvar "OSMODE")) (setvar "OSMODE" 0) (princ) (command "._TEXT" pt-ins height "" numbering) (setvar "OSMODE" old-osm) ) ;_ end of defun And this is the expression to check if it is working (draw-text (getpoint "Insertion Point: ") 5.0 "TEST") When I run the program I get Unkown commarnd "TEST" Any help would be appreciated. Thanks Quote
Lee Mac Posted April 28, 2020 Posted April 28, 2020 (edited) That example relies on the active Text Style having a text height set to zero. Edited April 28, 2020 by Lee Mac Quote
DDJL Posted April 28, 2020 Author Posted April 28, 2020 Lee Mac You are the greatest THANK YOU! Quote
BIGAL Posted April 28, 2020 Posted April 28, 2020 It is a problem with creating text like as lee has stated that depending on the text style it can have a height. Will try to find my workaround. At my last workplace it was enforced "Standard" was just that do not change. If you want something else make a new style. Quote
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.