Author Topic: Specific drawing files causing lisp routine to fail?  (Read 8222 times)

0 Members and 2 Guests are viewing this topic.

nivuahc

  • Guest
Re: Specific drawing files causing lisp routine to fail?
« Reply #30 on: August 25, 2006, 08:34:39 AM »
I'm running out of gas here. I'll pick up in the morning and see if I can get this through my knot head 

Just a note.
Some of us sometimes ask question to help with responding to the original or subsequent posts. If you dont understand the questions, please say so, 'cause usually a solution depends on your answers.

Please, everyone, listen to that advice. There is a wealth of knowledge being offered throughout this entire forum from the likes of Kerry and MP (among many, many others). You would be doing yourself a great disservice if you missed out on it by being afraid to say "I don't understand".

Too many times I've seen the original poster get frustrated and give up because it was obvious that the responses were over their heads. And, likewise, the people offering their help (free of charge, I might add) sometimes get frustrated because the questions they ask never get answered and it's almost as if they are being ignored by the very person they are trying to help.

If someone is trying to help you out, and they ask you a question, take the time to try your best at answering them. Like Kerry says, if you don't understand the question or the supplied information is over your head, say so. It will make things much easier for you in the long run, and it will make it a more pleasurable experience for the people trying to help you out.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Specific drawing files causing lisp routine to fail?
« Reply #31 on: August 25, 2006, 09:05:05 AM »
Well said nivuahc!

Here is the simple routine I often use to place text.

Code: [Select]
(defun _drawtext (txt txtjust txtpt txtang)
  ;; If text height is undefined (signified by 0 in the table)
  (if (= (cdr (assoc 40 (tblsearch "style" (getvar "textstyle")))) 0)
    ;; Draw the text using the current text height (textsize)
    (command "._text" "_J" txtjust txtpt "" txtang txt)
    ;; Otherwise use the defined text height
    (command "._text" "_J" txtjust txtpt txtang txt)
  ) ; endif
)

(defun c:test ()
  (defun rtd (r) (* 180.0 (/ r pi)))

  (and
    (setq mytext (getstring t "\nEnter text: "))
    (setq textpoint (getpoint "\nSelect text point."))
    (setq textangle (rtd 0.785398)) ; 45 degrees
    (_drawtext mytext "_m" textpoint textangle)
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: Specific drawing files causing lisp routine to fail?
« Reply #32 on: August 25, 2006, 10:12:34 AM »
Thanks Kerry!
My thing is I am trying to learn new ways to accomplish things so I am willing to struggle a bit to find the answer.
I didn't intend to be difficult for you. Especially when you are so graciously trying to help  :-)

Trust me I'm not afraid to say I don't have a clue :ugly:

I truly do appreciate the help I've gotten from this forum. Kerry, MP, CAB and many others have posted some extremely insightful articles here.

The normal working conditions of our drawing environment is using degrees.
What had me hung up on the question was to remember if I do have the drawing set to degrees in units,
Do I still need to convert with radians for the autocad api?
The other was the bulk of the routine written here on this forum by Kerry,
while being compartmentalized was in form much more advanced in its approach than I can interperet so I appreciate Kerry trying to lead me through it to find my own answers.
My conditional handling leaves a lot to be desired albeit non-existent lol.

« Last Edit: August 25, 2006, 10:14:19 AM by KewlToyZ »