Author Topic: Load textvalue from form  (Read 6560 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Load textvalue from form
« on: May 28, 2013, 09:05:43 AM »
Hi!

Anybody here that know how I can get textvalue from a definition form in a Lispvariable ?

owenwengerd

  • Bull Frog
  • Posts: 451
Re: Load textvalue from form
« Reply #1 on: May 28, 2013, 09:33:35 AM »
Are you looking for (dcl_Control_GetText)?

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Load textvalue from form
« Reply #2 on: May 28, 2013, 10:35:59 AM »
Yes I know that, but I have definition standards in ODCL_form (see form.bmp)
When I start Lispcode it shows for example in first Line
 Asfaltbetongslitlager för "huvudgata"
If I don´t change the line I want that line should save in Lispvariable

Code: [Select]
(defun c:Materialtabell_Form1_tb1-1_OnEditChanged (NewValue /)
  (if (null (setq tb1-1 (dcl_Control_GetText Materialtabell_Form1_tb1-1)))
    (setq tb1-1 "")
    )

Here it saves ony empty

owenwengerd

  • Bull Frog
  • Posts: 451
Re: Load textvalue from form
« Reply #3 on: May 28, 2013, 10:55:04 AM »
I'm not sure I understand correctly, but I suspect this is what you're after:

Code - Auto/Visual Lisp: [Select]
  1. (setq tb1-1 NewValue)

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Load textvalue from form
« Reply #4 on: May 29, 2013, 02:47:00 AM »
Maybe not possible. :-(
Another question is, I type i values in editbox (textbox) from Materialtabell_Form1.
If I press Enter after complete it close the form than I want create a block and fill the attributes with values from Form1.

Code: [Select]
(defun c:test ()
  (setvar "CMDECHO" 0)
  (command "_OPENDCL")
  (dcl_project_load (strcat DCL "Materialtabell.odcl"))
  (setq Result (dcl_form_show MaterialTabell_Form1))
  (command "_insert"....
  )

In the code it would create the block before I type in values, how can I ask if all textboxes have values it should create the block ?

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Load textvalue from form
« Reply #5 on: May 29, 2013, 04:49:09 AM »
Can somebody see whats wrong

Code: [Select]
(defun cp:control (/ )
  (if (= nil
           (member nil
               (list tb1-1
                     tb1-2
                     tb2-1
                     tb2-2
                     tb3-1
                     tb3-2
                     tb4-1
                     tb4-2
                     tb5-1
                     tb5-2
                     tb6-1
                     tb6-2
                )
             )
          )
    (princ "ok")
    (princ "Tabelle unvollständig !")
    )
  (princ)
  )


(defun c:test ()
  (setvar "CMDECHO" 0)
  (command "_OPENDCL")
  (dcl_project_load (strcat DCL "Materialtabell.odcl"))
  (dcl_form_show MaterialTabell_Form1)
  )

(defun c:Materialtabell_Form1_tb1-1_OnEditChanged (NewValue /)
  (if (null (setq tb1-1 (dcl_Control_GetText Materialtabell_Form1_tb1-1)))
    (setq tb1-1 "")
    )
  )

(defun c:Materialtabell_Form1_tb1-2_OnEditChanged (NewValue /)
  (if (null (setq tb1-2 (dcl_Control_GetText Materialtabell_Form1_tb1-2)))
    (setq tb1-2 "")
    )
)
(defun c:Materialtabell_Form1_tb2-1_OnEditChanged (NewValue /)
  (if (null (setq tb2-1 (dcl_Control_GetText Materialtabell_Form1_tb2-1)))
    (setq tb2-1 "")
    )
)
(defun c:Materialtabell_Form1_tb2-2_OnEditChanged (NewValue /)
  (if (null (setq tb2-2 (dcl_Control_GetText Materialtabell_Form1_tb2-2)))
    (setq tb2-2 "")
    )
)
(defun c:Materialtabell_Form1_tb3-1_OnEditChanged (NewValue /)
  (if (null (setq tb3-1 (dcl_Control_GetText Materialtabell_Form1_tb3-1)))
    (setq tb3-1 "")
    )
)
(defun c:Materialtabell_Form1_tb3-2_OnEditChanged (NewValue /)
  (if (null (setq tb3-2 (dcl_Control_GetText Materialtabell_Form1_tb3-2)))
    (setq tb3-2 "")
    )
)
(defun c:Materialtabell_Form1_tb4-1_OnEditChanged (NewValue /)
  (if (null (setq tb4-1 (dcl_Control_GetText Materialtabell_Form1_tb4-1)))
    (setq tb4-1 "")
    )
)
(defun c:Materialtabell_Form1_tb4-2_OnEditChanged (NewValue /)
  (if (null (setq tb4-2 (dcl_Control_GetText Materialtabell_Form1_tb4-2)))
    (setq tb4-2 "")
    )
)
(defun c:Materialtabell_Form1_tb5-1_OnEditChanged (NewValue /)
  (if (null (setq tb5-1 (dcl_Control_GetText Materialtabell_Form1_tb5-1)))
    (setq tb5-1 "")
    )
)
(defun c:Materialtabell_Form1_tb5-2_OnEditChanged (NewValue /)
  (if (null (setq tb5-2 (dcl_Control_GetText Materialtabell_Form1_tb5-2)))
    (setq tb5-2 "")
    )
)
(defun c:Materialtabell_Form1_tb6-1_OnEditChanged (NewValue /)
  (if (null (setq tb6-1 (dcl_Control_GetText Materialtabell_Form1_tb6-1)))
    (setq tb6-1 "")
    )
)
(defun c:Materialtabell_Form1_tb6-2_OnEditChanged (NewValue /)
  (if (null (setq tb6-2 (dcl_Control_GetText Materialtabell_Form1_tb6-2)))
    (setq tb6-2 "")
    )
)
(defun c:Materialtabell_Form1_OnInitialize (/)
  (cp:control)
)

(defun c:Materialtabell_Form1_OnOK (/)
  (command "_insert" "MaterialTabell"  (getpoint "\nWähle Einfügepunkt ") (getvar "DIMSCALE") (getvar "DIMSCALE") 0
             tb1-1
             tb1-2
             tb2-1
             tb2-2
             tb3-1
             tb3-2
             tb4-1
             tb4-2
             tb5-1
             tb5-2
             tb6-1
             tb6-2
             )
)




owenwengerd

  • Bull Frog
  • Posts: 451
Re: Load textvalue from form
« Reply #6 on: May 29, 2013, 12:56:00 PM »
I think you're looking for the (and) function. Please start a new thread ehwn you have a new question, otherwise the existing thread gets polluted.