<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DCL - logic in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13628888#M444</link>
    <description>&lt;P&gt;1. Please assign a KEY to the radio button container: "TipoDeFaxia"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Next, Let's concentrate on this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;; Botões&lt;BR /&gt;(action_tile "ok" "(done_dialog 1)")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user has made his selection and is ready to continue.&lt;/P&gt;&lt;P&gt;At this time we will gather the state of ALL tiles in the dialog (and save as a LIST as needed).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(action_tile "ok" "(TEST_GET)(done_dialog 1)")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where TEST_GET is a call to a subroutine to gather and store the dialog state.&lt;/P&gt;&lt;P&gt;(defun TEST_GET ()&lt;/P&gt;&lt;P&gt;&amp;nbsp;(setq a (get_tile "TipoDeFaixa"))&lt;/P&gt;&lt;P&gt;);end TEST_GET&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note I have structured this way as it can be expandable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;For radio buttons, communicate with the container and not the children inside the container.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now that you have exited the dialog, the (local) variable "a" contains all the information needed to begin the execution part of your program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As Gile has stated, tiles MUST BE INITIALIZED.&lt;/P&gt;&lt;P&gt;As an example, a TOGGLE has 3 values: "0", "1" and nil.&lt;/P&gt;&lt;P&gt;A program will fail when written to accept "0" and "1" only where the tile is not initialized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;STRIKE&gt;(set_tile "rb_fp" "1")&lt;/STRIKE&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;For radio buttons, assign the container one of the children:&lt;/P&gt;&lt;P&gt;(set_tile "TipoDeFaxia" "rb_fp")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bonus Material:&lt;/P&gt;&lt;P&gt;Between new_dialog and start_dialog add these comments (divisions) to your template:&lt;/P&gt;&lt;P&gt;;** INITIALIZE **&lt;/P&gt;&lt;P&gt;;** SET TILE **&lt;/P&gt;&lt;P&gt;;** MODE TILE **&lt;/P&gt;&lt;P&gt;;** ACTION TILE **&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Tue, 13 May 2025 21:45:08 GMT</pubDate>
    <dc:creator>scot-65</dc:creator>
    <dc:date>2025-05-13T21:45:08Z</dc:date>
    <item>
      <title>DCL - logic</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13627464#M441</link>
      <description>&lt;P&gt;Hello everyone! I'm studying the logic of this DCL, so that 2 routines work in the same DCL. However, the logic part returns only one of the routines regardless of the button I select.&lt;/P&gt;&lt;P&gt;I thank everyone who can contribute.&lt;/P&gt;&lt;P&gt;My greetings to everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:TEST_DCL(/ dcl_id dclfile f)&lt;/P&gt;&lt;P&gt;(vl-load-com)&lt;BR /&gt;(setvar "OSMODE" 0)&lt;/P&gt;&lt;P&gt;;; Cria o DCL temporário&lt;BR /&gt;(setq dclfile (vl-filename-mktemp "MENU.dcl"))&lt;BR /&gt;(setq f (open dclfile "w"))&lt;BR /&gt;(foreach line&lt;BR /&gt;'(&lt;BR /&gt;"MENU : dialog { label = \"MENU\";"&lt;BR /&gt;" : column {"&lt;BR /&gt;" : boxed_radio_column { label = \"Tipo de Faixa\";"&lt;BR /&gt;" : radio_button { label = \"GOOD MORNING\" ; key = \"rb_fp\" ; }"&lt;BR /&gt;" : radio_button { label = \"GOODNIGHT\" ; key = \"rb_fxe\" ; }"&lt;BR /&gt;" }"&lt;BR /&gt;" : row {"&lt;BR /&gt;" : button { label = \"OK\" ; key = \"ok\" ; fixed_width = true; width = 15; alignment = centered; is_default = true; }"&lt;BR /&gt;" : button { label = \"Cancel\" ; key = \"cancel\" ; fixed_width = true; width = 15; alignment = centered; is_cancel = true; }"&lt;BR /&gt;" }"&lt;BR /&gt;" }"&lt;BR /&gt;"}"&lt;BR /&gt;)&lt;BR /&gt;(write-line line f)&lt;BR /&gt;)&lt;BR /&gt;(close f)&lt;/P&gt;&lt;P&gt;;; Carrega o DCL&lt;BR /&gt;(setq dcl_id (load_dialog dclfile))&lt;BR /&gt;(if (not (new_dialog "MENU" dcl_id))&lt;BR /&gt;(progn&lt;BR /&gt;(alert "Error DCL.")&lt;BR /&gt;(vl-file-delete dclfile)&lt;BR /&gt;(exit)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Valor padrão&lt;BR /&gt;(set_tile "rb_fp" "1")&lt;/P&gt;&lt;P&gt;;; Botões&lt;BR /&gt;(action_tile "ok" "(done_dialog 1)")&lt;BR /&gt;(action_tile "cancel" "(done_dialog 0)")&lt;/P&gt;&lt;P&gt;;; Exibe o diálogo&lt;BR /&gt;(if (= (start_dialog) 1)&lt;BR /&gt;(progn&lt;BR /&gt;(unload_dialog dcl_id)&lt;BR /&gt;(vl-file-delete dclfile)&lt;/P&gt;&lt;P&gt;;; Verifica qual opção foi marcada&lt;BR /&gt;(if (= (get_tile "rb_fp") "1")&lt;BR /&gt;(c:F1) ; GOOD MORNING&lt;BR /&gt;(c:F2) ; GOODNIGHT&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(princ "\nOperation completed successfully.\n")&lt;BR /&gt;)&lt;BR /&gt;(progn&lt;BR /&gt;(unload_dialog dcl_id)&lt;BR /&gt;(vl-file-delete dclfile)&lt;BR /&gt;(princ "\n cancelled oparation\n")&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(defun c:F1 ()&lt;BR /&gt;(alert "GOOD MORNING")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(defun c:F2 ()&lt;BR /&gt;(alert "GOODNIGHT")&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 07:48:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13627464#M441</guid>
      <dc:creator>sigmmadesigner</dc:creator>
      <dc:date>2025-05-13T07:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: DCL - logic</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13627578#M442</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;One way could be storing the value of "rb_fp" tile in a local variable (rb_fp) and the value return by start_dialog in another one (status), close the dialog and do what you want according to these variables values.&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:TEST_DCL (/ dcl_id dclfile f rb_fp status)

  (vl-load-com)
  (setvar "OSMODE" 0)

  ;; Cria o DCL temporário
  (setq dclfile (vl-filename-mktemp "MENU.dcl"))
  (setq f (open dclfile "w"))
  (foreach line
	   '(
	     "MENU : dialog { label = \"MENU\";"
	     " : column {"
	     " : boxed_radio_column { label = \"Tipo de Faixa\";"
	     " : radio_button { label = \"GOOD MORNING\" ; key = \"rb_fp\" ; }"
	     " : radio_button { label = \"GOODNIGHT\" ; key = \"rb_fxe\" ; }"
	     " }"
	     " : row {"
	     " : button { label = \"OK\" ; key = \"ok\" ; fixed_width = true; width = 15; alignment = centered; is_default = true; }"
	     " : button { label = \"Cancel\" ; key = \"cancel\" ; fixed_width = true; width = 15; alignment = centered; is_cancel = true; }"
	     " }"
	     " }"
	     "}"
	    )
    (write-line line f)
  )
  (close f)

  ;; Carrega o DCL
  (setq dcl_id (load_dialog dclfile))
  (if (not (new_dialog "MENU" dcl_id))
    (progn
      (alert "Error DCL.")
      (vl-file-delete dclfile)
      (exit)
    )
  )

  ;; Valor padrão
  (set_tile "rb_fp" "1")

  ;; Botões
  (action_tile "ok" "(setq rb_fp (get_tile \"rb_fp\")) (done_dialog 1)")
  (action_tile "cancel" "(done_dialog 0)")

  (setq status (start_dialog))
  (unload_dialog dcl_id)
  (vl-file-delete dclfile)

  (if (= status 1)
    (progn
      (if (= rb_fp "1")
	(c:F1)				; GOOD MORNING
	(c:F2)				; GOODNIGHT
      )
      (princ "\nOperation completed successfully.\n")
    )
    (princ "\n cancelled oparation\n")
  )

  (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 13 May 2025 08:51:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13627578#M442</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2025-05-13T08:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: DCL - logic</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13628521#M443</link>
      <description>&lt;P&gt;when dealing with radio buttons especially when there's more than two I prefer to do the following:&lt;/P&gt;&lt;P&gt;1. set default radio button setting:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; setup default variable
(setq rb_option "rb_fp")
; setup default radio button selection
(set_tile rb_option "1")&lt;/LI-CODE&gt;&lt;P&gt;2. set actions for each radio button:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(foreach itm '("rb_fp" "rb_fxe") ; apply action to each item in list showing all radio button keys
 (action_tile itm "(setq rb_option $key)") ; set variable to radio button key selected
)&lt;/LI-CODE&gt;&lt;P&gt;3. after dialog is dismissed by pressing OK then setup test condition:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;; Verifica qual opção foi marcada
(cond 
 ((= rb_option "rb_fp")
  (c:F1) ; GOOD MORNING
 )
 ((= rb_option "rb_fxe")
  (c:F2) ; GOODNIGHT
 )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 17:07:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13628521#M443</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2025-05-13T17:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: DCL - logic</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13628888#M444</link>
      <description>&lt;P&gt;1. Please assign a KEY to the radio button container: "TipoDeFaxia"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Next, Let's concentrate on this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;; Botões&lt;BR /&gt;(action_tile "ok" "(done_dialog 1)")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user has made his selection and is ready to continue.&lt;/P&gt;&lt;P&gt;At this time we will gather the state of ALL tiles in the dialog (and save as a LIST as needed).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(action_tile "ok" "(TEST_GET)(done_dialog 1)")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where TEST_GET is a call to a subroutine to gather and store the dialog state.&lt;/P&gt;&lt;P&gt;(defun TEST_GET ()&lt;/P&gt;&lt;P&gt;&amp;nbsp;(setq a (get_tile "TipoDeFaixa"))&lt;/P&gt;&lt;P&gt;);end TEST_GET&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note I have structured this way as it can be expandable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;For radio buttons, communicate with the container and not the children inside the container.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now that you have exited the dialog, the (local) variable "a" contains all the information needed to begin the execution part of your program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As Gile has stated, tiles MUST BE INITIALIZED.&lt;/P&gt;&lt;P&gt;As an example, a TOGGLE has 3 values: "0", "1" and nil.&lt;/P&gt;&lt;P&gt;A program will fail when written to accept "0" and "1" only where the tile is not initialized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;STRIKE&gt;(set_tile "rb_fp" "1")&lt;/STRIKE&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;For radio buttons, assign the container one of the children:&lt;/P&gt;&lt;P&gt;(set_tile "TipoDeFaxia" "rb_fp")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bonus Material:&lt;/P&gt;&lt;P&gt;Between new_dialog and start_dialog add these comments (divisions) to your template:&lt;/P&gt;&lt;P&gt;;** INITIALIZE **&lt;/P&gt;&lt;P&gt;;** SET TILE **&lt;/P&gt;&lt;P&gt;;** MODE TILE **&lt;/P&gt;&lt;P&gt;;** ACTION TILE **&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 21:45:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13628888#M444</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2025-05-13T21:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: DCL - logic</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13628911#M445</link>
      <description>&lt;P&gt;((defun c:TEST_DCL (/ dcl_id dclfile f)&lt;BR /&gt;(vl-load-com)&lt;BR /&gt;(setvar "OSMODE" 0)&lt;/P&gt;&lt;P&gt;;; Cria o DCL temporário&lt;BR /&gt;(setq dclfile (vl-filename-mktemp "MENU.dcl"))&lt;BR /&gt;(setq f (open dclfile "w"))&lt;BR /&gt;(foreach line&lt;BR /&gt;'(&lt;BR /&gt;"MENU : dialog { label = \"MENU\";"&lt;BR /&gt;" : column {"&lt;BR /&gt;" : boxed_radio_column { label = \"Tipo de Faixa\";"&lt;BR /&gt;" : radio_button { label = \"GOOD MORNING\" ; key = \"rb_fp\" ; }"&lt;BR /&gt;" : radio_button { label = \"GOODNIGHT\" ; key = \"rb_fxe\" ; }"&lt;BR /&gt;" }"&lt;BR /&gt;" : row {"&lt;BR /&gt;" : button { label = \"OK\" ; key = \"ok\" ; fixed_width = true; width = 15; alignment = centered; is_default = true; }"&lt;BR /&gt;" : button { label = \"Cancel\" ; key = \"cancel\" ; fixed_width = true; width = 15; alignment = centered; is_cancel = true; }"&lt;BR /&gt;" }"&lt;BR /&gt;" }"&lt;BR /&gt;"}"&lt;BR /&gt;)&lt;BR /&gt;(write-line line f)&lt;BR /&gt;)&lt;BR /&gt;(close f)&lt;/P&gt;&lt;P&gt;;; Carrega o DCL e verifica se foi carregado corretamente&lt;BR /&gt;(setq dcl_id (load_dialog dclfile))&lt;BR /&gt;(if (not (new_dialog "MENU" dcl_id))&lt;BR /&gt;(progn&lt;BR /&gt;(alert "Erro ao carregar o diálogo.")&lt;BR /&gt;(vl-file-delete dclfile)&lt;BR /&gt;(exit)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Define o botão de rádio padrão: GOOD MORNING&lt;BR /&gt;(set_tile "rb_fp" "1")&lt;/P&gt;&lt;P&gt;;; Define ações para os botões OK e Cancel&lt;BR /&gt;(action_tile "ok" "(done_dialog 1)")&lt;BR /&gt;(action_tile "cancel" "(done_dialog 0)")&lt;/P&gt;&lt;P&gt;;; Inicia o diálogo e processa o resultado&lt;BR /&gt;(if (= (start_dialog) 1)&lt;BR /&gt;(progn&lt;BR /&gt;;; Verifica a opção selecionada: se "rb_fp" estiver ativo, chama c:F1; caso contrário, chama c:F2.&lt;BR /&gt;(if (equal (get_tile "rb_fp") "1")&lt;BR /&gt;(c:F1) ; GOOD MORNING&lt;BR /&gt;(c:F2) ; GOODNIGHT&lt;BR /&gt;)&lt;BR /&gt;(princ "\nOperation completed successfully.\n")&lt;BR /&gt;)&lt;BR /&gt;(princ "\nOperação cancelada.\n")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Libera o diálogo e remove o arquivo temporário&lt;BR /&gt;(unload_dialog dcl_id)&lt;BR /&gt;(vl-file-delete dclfile)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(defun c:F1 ()&lt;BR /&gt;(alert "GOOD MORNING")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(defun c:F2 ()&lt;BR /&gt;(alert "GOODNIGHT")&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 22:41:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13628911#M445</guid>
      <dc:creator>sigmmadesigner</dc:creator>
      <dc:date>2025-05-13T22:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: DCL - logic</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13629050#M446</link>
      <description>&lt;P&gt;This is a library version of a Radio buttons Dcl can be used in any code returns button selected, look at sample code in top of the attached. Your welcome to use.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 02:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dcl-logic/m-p/13629050#M446</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-05-14T02:03:14Z</dc:date>
    </item>
  </channel>
</rss>

