Recent posts

#91
Runtime/AutoLISP / "Project failed to load" quest...
Last post by TCNTRM - October 25, 2023, 10:54:06 PM
Hi!

I searched but couldn't find solution to my problem. My files are on USB stick (.lisp files and .odcl file). If I plug in the USB first then run Autocad ODCL project loads okay, BUT when I first run Autocad and then plug USB into pc, I get error "Project failed to load! The file could not be found or an error occurred while reading the file"


#92
Runtime/AutoLISP / Re: OnKeyUp event
Last post by Fred Tomke - October 25, 2023, 08:40:23 AM
Great! I only use KeyDown in some ListViews and grids to recognize, when Delete was pressed. Changes in textboxes I always check with EditChanged or Update event.
Regards, Fred
#93
Runtime/AutoLISP / Re: OnKeyUp event
Last post by Dovys - October 25, 2023, 07:30:59 AM
Yes.
(defun c:Savartos/Main/TBGNew#OnKeyUp (Character RepeatCount Flags / letter)
  (setq letter (dcl-Control-GetText Savartos/Main/TBGNew))
)

I just ignore "Character RepeatCount Flags" and take text from text box with dcl-Control-GetText
#94
Runtime/AutoLISP / Re: OnKeyUp event
Last post by Fred Tomke - October 25, 2023, 06:40:32 AM
That means, you have a solution now?
Fred
#95
Runtime/AutoLISP / Re: OnKeyUp event
Last post by Dovys - October 25, 2023, 06:14:49 AM
Hi,
yes, I know here are more events on key press.
I have tested you code (attached image). In window you can see 6 events.
1) Shift key Down.
2) @ key Down.
3) Shift key Up.
4) @ key Up.
5) 2 key Down.
6) 2 key Up.

And in Input you can see @2
shift key Char is unknown and ASCII is 16, but in case of @ and 2 both are Char 2 and ASCII 50. This means it is not possible to get @ symbol (and all other symbols in this button row on keyboard) in lisp.
Input text box have symbol @ but lisp have events of two key presses.

Writing this messages I got how can I get it. All I need from key up event is only even itself, but I don't need Character variable, I just need to read content of text box.
In my code only one letter can be entered in text box and this letter needs to be in hard coded list and not be in list of already entered letters.

Thanks for help.
#96
Runtime/AutoLISP / Re: OnKeyUp event
Last post by Fred Tomke - October 25, 2023, 01:31:12 AM
Hi, I'm not sure if you know that many events will be fired for a single @-char?
I attached a small example for demonstration. I hope I'm on the right path, sorry if not.
With regards, Fred
#97
Runtime/AutoLISP / Re: OnKeyUp event
Last post by Dovys - October 24, 2023, 10:35:56 PM
I don't understand if we talk about same thing so I will try to explain in more details.

I use Visual Studio Code as my IDE. I have run lisp with OpenDCL in debug mode from VSC.
After I open GUI made with OpenDCL in AutoCAD and enter symbol into text box I see @ but in VSC variable "Character" is 2

(defun c:Savartos/Main/TBGNew#OnKeyUp (Character RepeatCount Flags /)

Because of this if I want to check if symbol @ was entered I don't know how, because in lisp I only see number 2. I have attached image.
#98
Runtime/AutoLISP / Re: OnKeyUp event
Last post by Fred Tomke - October 24, 2023, 01:57:32 PM
Hi, that depends on the keys you need to input @ character. For the German keyboard layout I need to press AltGr to get @ sign. So the numer 2 and 4 are the key codes for the additional key.
I hope it was understandable.
With regards, Fred
#99
Runtime/AutoLISP / OnKeyUp event
Last post by Dovys - October 24, 2023, 12:40:13 PM
Hi,
I am trying to use OnKeyUp event on TextBox, it works if I use letter buttons, but if I try to use buttons above letter buttons like button "@" in text box I see symbol "@", but function KeyUp gives me number "2" in variable Character.
I try to get non English letters from this buttons after I set Keyboard layout to my language and here are some letters on buttons "@", "$" and so on.
Like button "@" have letter "Č" and button "$" have letter "Ė". But I only get number 2 or 4.
#100
Runtime/AutoLISP / textbox not updating
Last post by Domzinator - October 20, 2023, 02:10:20 PM
Hi Guys i am trying to update a textbox when the form iInitializes but this does not seem to work i cant understand why. Here is my code:


(setq txt "This is a test")
(defun c:MyCivil3D/Form1#OnInitialize (/)
(dcl-Control-SetText MyCivil3D/Form1/TextBox1 txt)
)