The form opens but the picture is not drawn

Started by little_figd, April 26, 2023, 02:58:43 AM

Previous topic - Next topic


I try to make a drawing through the form, I made a code using DCL, the form itself opens, but the drawing does not appear. tell me please what i did wrong. 
I attach the code

(command "OPENDCL")
(defun c:Main ()
  (dcl_Project_Load "D:\Lb4" T)
  (dcl_Form_Show Lb4_Form1)
(defun c:Lb4/Form1/TextButton1#OnClicked (/)
    (setq CoordX (atof(dcl-Control-GetText Lb4/Form1/TextBox1)))
    (setq CoordY (atof(dcl-Control-GetText Lb4/Form1/TextBox2)))
    (setq d (atof(dcl-Control-GetText Lb4/Form1/TextBox3)))
    (setq a (atof(dcl-Control-GetText Lb4/Form1/TextBox4)))
    (setq b (atof(dcl-Control-GetText Lb4/Form1/TextBox5)))

(defun Lb4(d a b CoordX CoordY)

(setq StartPoint (list CoordX CoordY))

(command "circle" StartPoint (/ d 2))
(setq p1 (list (- 0 (/ a 2)) (- 0 (/ b 2)))
       p2 (list (/ a 2) (/ b 2)))
  (command "rectang" p1 p2)
  (dcl_messagebox (strcat "done"))
  (dcl_Form_Close Lb4_Form1)

Fred Tomke

Hello, the command will not work, until the form is open.

With regards,
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]