Jump to content

Recommended Posts

Posted

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

Posted (edited)

That example relies on the active Text Style having a text height set to zero.

Edited by Lee Mac
Posted

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.

 

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...