Solved! Go to Solution.
Solved by norman.yuan. Go to Solution.
For .NET interacting with LISP variables, give this a read: http://www.theswamp.org/index.php?topic=35714.0
You might also consider the USERR* and USERS* system variables.
Cheers
"How we think determines what we do, and what we do determines what we get."
After running the code
dim myint as integer= textbox1.text
application.setsystemvariable("Useri1", myint)
did you go to the command line for "USERS1" right after with the same drawing? There is no reason the above code does not work.
You may be aware that if there are multiple drawings are open, Application.SetSystemVariable() sets system variables of current drawing (MdiActiveDocument). Also, different from other USER variables (USERRx and USERIx), USERSx do not save their value inside the drawing. That is, if the drawing is closed and opened again, the USERSx value set in previous AutoCAD session will be gone.
Norman Yuan
Rather than trying to set a variable, create a method as a LISP function that returns a value. That way it can be called the same way as a LISP function, even if its just (setq tval (MyNETFunction)).
Don't rely too much on the USER* variables - other functions may be using them and writing/rewriting values can have unexpected results.