how to remember my prompt options in session, and how to print to prompt (without any options)

how to remember my prompt options in session, and how to print to prompt (without any options)

5thSth
Advocate Advocate
288 Views
2 Replies
Message 1 of 3

how to remember my prompt options in session, and how to print to prompt (without any options)

5thSth
Advocate
Advocate

hi,

 

I'm back after a long time trying to customize my cad...

can someone tell me how to save my prompt options, so when I reuse the command the last choice is used as the promptoptions.DefaultValue?

 

also, how can we print simple lines of text (status) in the prompt (sort of like a debugger) ?

0 Likes
Accepted solutions (1)
289 Views
2 Replies
Replies (2)
Message 2 of 3

_gile
Consultant
Consultant
Accepted solution

@5thSth  a écrit :

can someone tell me how to save my prompt options, so when I reuse the command the last choice is used as the promptoptions.DefaultValue?


You can use fields (global variables) in the class containing the command method. If the command method is static the static fields are accessible from all documents in the session, if the command method is not static (instance method) the non static fields are 'per document' (see this topic and the following).

 


@5thSth  a écrit :

also, how can we print simple lines of text (status) in the prompt (sort of like a debugger) ?


Simply use the Editor.WriteMessage() method.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 3

5thSth
Advocate
Advocate

thanks.
been a some 4 years xsince I've been here... but I still remember your user name! 😄
Thanks. Both work as a charm.

0 Likes