Displaying system variables
Displaying system variables
(OP)
I've figured out how to calculate the info I want by the use of a lisp file, but I can't get the info I want onto the drawing. I was planning on using a field to display a user variable (have the code written and all), but none of the user variables are available for display, and when I enter the code manually, I just get ####.
Is there any way to display the user variables (userr1, userr2, etc..) in a field like you would another system variable? Or is there another easy way to display the variables from a lisp file? Can I use a diesel function to display the variables?
Is there any way to display the user variables (userr1, userr2, etc..) in a field like you would another system variable? Or is there another easy way to display the variables from a lisp file? Can I use a diesel function to display the variables?





RE: Displaying system variables
RE: Displaying system variables
(defun c:sv2txt ()
(setq txt (rtos (getvar "userr1")))
(setq pt1 (getpoint "Pick start point for text: "))
(command "text" pt1 "" "" txt "" "")
)
Note that the last line might need some massaging due to your current text style settings.
This won't autoupdate like a field would though. I don't know how to get a user variable into a field.
RE: Displaying system variables
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: Displaying system variables
My original question still stands however, because I'm sure I'll want to apply this to another dwg. How do you display a sytem variable such as userr1 in autocad (preferably w/o a lispfile); and how do you display a variable from a lispfile in a dimension, textbox, attribute, etc.?
RE: Displaying system variables
RE: Displaying system variables
You can show the value of a lisp variable on the command line by using a leading exclamation point as IFR showed, but that doesn't work for a system variable.
RE: Displaying system variables