Jump to content

Recommended Posts

Posted (edited)

I am looking create my first lisp and DCL.

I know it is a little complex but it is something similar to sheet set. Like a Project manager for AutoCAD.

Title Block entre, revision control and data link with excel.

What I am having trouble with is needing mutable tabs

image.png.f55b8bce1b902dd0af3b0433cf034cfe.png

But I am not finding what others have done or even trying to find “Osnap or Dimstyle” to see how DCL code is written. I can’t find the Osnap or Dimstyle DCL file in AutoCAD directory?

Edited by cadmando2
Posted

Don't think that is DCL. You might take a look at OpenDCL, it's a bit more advanced.

Posted (edited)

I just use inbuilt dcl not opendcl as most of my work goes to others so that is an extra install by the end user. But it is very good.

 

I think what you want there is what is known as a Button in dcl this in turn can open a "CHILD" dcl, in image below size has been clicked, the size dcl has sliders, input values, and a total, change any option and total width is updated.

 

image.png.4082a32bc309997bae034a646490eb9b.png

 

 

Edited by BIGAL
Posted

I saw this similar once -kind of- with plain DCL where selecting a different tab closed the DCL and opened a new DCL showing those tab options, I think the tabs at the top were images with different background colours, lighter or darker to show which was selected.

Posted

I am hopping someone has done something similar that can help!

 

Posted

Did you google opendcl tabs, I glanced in the opendcl forum and this subject was up near top of opendcl & lisp

Posted

IIRC, you can do Tabs in a VBA User Form.
 

Like mentioned, OpenDCL, but needs installed on all machines, which may not be a big deal or could be a show stopper.

 

As mentioned AutoCAD DCL doesn't do tabs, you will have to fake it, plain and simple.

 

Go HERE and check out DCL_Tiles

 

 

DCL_Tabs.png

  • Like 1
  • Agree 1
Posted
5 hours ago, SLW210 said:

IIRC, you can do Tabs in a VBA User Form.
 

Like mentioned, OpenDCL, but needs installed on all machines, which may not be a big deal or could be a show stopper.

 

As mentioned AutoCAD DCL doesn't do tabs, you will have to fake it, plain and simple.

 

Go HERE and check out DCL_Tiles

 

 

DCL_Tabs.png

There run the lisp and dcl file and gives me a "vector_text syntax error:
Values for X and Y must be a positive number.; error: quit / exit abort" error

 

Posted
Quote

I am looking create my first lisp and DCL.

 

If the layout is also important to you and making it very functional/comprehensible for the user, OpenDCL is a gift ! 🥳
The possibilities are limitless - Let me know if you need example!
I'm just working on a stair section...
 

Posted

 

On 6/7/2022 at 3:24 PM, cadmando2 said:

There run the lisp and dcl file and gives me a "vector_text syntax error:
Values for X and Y must be a positive number.; error: quit / exit abort" error

 

I have no idea what you are asking?

 

 

 

On 6/10/2022 at 4:38 PM, Leika said:

 

If the layout is also important to you and making it very functional/comprehensible for the user, OpenDCL is a gift ! 🥳
The possibilities are limitless - Let me know if you need example!
I'm just working on a stair section...
 

 

Like stated, it needs installed on all users machines AFAIK. That is a show stopper where I work.

 

VBA is a very fast learning curve usually, very easy for TABS as well. 

 

The LISP examples shown previous look very nice.

Posted

Thanks for the Help, but I am just going trying figure it out someway! maybe it to complex for anyone! not a big deal, just though it would be a fun project!

 

 

Posted

Bit of a work in progress as an example of the principle I mentioned above using LISP / DCL. Another of those questions which is something I have been meaning to make up for something else ages ago

 

Still need to get swapping between tabs going properly, it is limnited (by AutoCAD) to 8 'children'; but see what you think. Works by opening another dialogue box on top of the original, and when you cancel / accept that cascades through them all closing all the dialogue boxes. Next task for me is to remember where I saw the instruction on closing them opening dialogue boxes - think I have that in my brain somewhere - to remove the limitation of children

 

 

(defun c:testthis ( / )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (defun Tab1 ( / dcl1 des1 dch1 x)
;;;DCL 1 ;;DCL on the fly: Ideas by Lee Mac and Cadtutor forums
;;create DCL pop up box
  (if
    (and
      (setq dcl1 (strcat (getvar "TEMPPREFIX") "DCLTab1.dcl"))
      (setq des1 (open dcl1 "w"))
      (foreach x
        '(
"           pass : dialog"
"           {"
"             key = \"Lispdialoguebox\";"
"             label = \"A Dialogue Box\";"
"             spacer;"

"             : column { width=80;"
"                 : row {"
"                   : button { key = \"Tab1\"; label = \"Tab1\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab2\"; label = \"Tab2\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab3\"; label = \"Tab3\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab4\"; label = \"Tab4\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   spacer;"
"                 }"
"             }"

"             : boxed_column { width=80; label = \"A TITLE HERE 'Tab 1'\";"
"               : row { width=80; alignment = centered;"
"                 : column {width = 20; alignment = centered;"

"                   :row {alignment = bottom;"
"                     : text { key = \"text1-a\"; label = \"Lets Make  DCL!\"; width = 20; alignment = right;}"
"                   }"
"                   : row {width = 40; alignment = left;"
"                     : text { key = \"text1-b\"; label = \"and put all the fun bits here\"; width = 20; alignment = right;}"
"                   }"

"                 }"
"               }"
"             }"


"             : boxed_column { width=80; alignment = left;"
"               : row {"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"accept\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"               }"
"             }"

"           }"
          )
        (write-line x des1)
      )
      (not (setq des1 (close des1)))
      (< 0 (setq dch1 (load_dialog dcl1)))
      (new_dialog "pass" dch1)
    )
;;End of DCL pop up box definition
    (progn

;;makes a pop-up list box

      (action_tile "Tab2"   "(Tab2)(done_dialog 1)")
      (action_tile "Tab3"   "(Tab3)(done_dialog 1)")
      (action_tile "Tab4"   "(Tab4)(done_dialog 1)")
      (action_tile "accept" "(done_dialog 1)")
      (action_tile "cancel" "(done_dialog 0)")

      (start_dialog)
    ) ;;end of DCL1 'and' above
    (princ "\nError. Unable to load dialogue box.")
  ) ;;end of DCL1 'if' above
  (vl-file-delete dcl1) ;;delete the temp DCL file
  ) ; end defun tab 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Tab2 ( / dcl2 des2 dch2 x)

  (if
    (and
      (setq dcl2 (strcat (getvar "TEMPPREFIX") "DCLTab2.dcl"))
      (setq des2 (open dcl2 "w"))
      (foreach x
        '(
"           pass : dialog"
"           {"
"             key = \"Lispdialoguebox\";"
"             label = \"Popped Up to say Hello\";"
"             spacer;"

"             : column { width=80;"
"                 : row {"
"                   : button { key = \"Tab1\"; label = \"Tab1\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab2\"; label = \"Tab2\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab3\"; label = \"Tab3\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab4\"; label = \"Tab4\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   spacer;"
"                 }"
"             }"

"             : boxed_column { width=80; label = \"A TITLE HERE 'Tab 2'\";"
"               : row { width=80; alignment = centered;"
"                 : column {width = 20; alignment = centered;"

"                   :row {alignment = bottom;"
"                     : text { key = \"text1-a\"; label = \"Aha!! Tab 2!!\"; width = 20; alignment = right;}"
"                   }"
"                   : row {width = 40; alignment = left;"
"                     : text { key = \"text1-b\"; label = \"put more fun bits here\"; width = 20; alignment = right;}"
"                   }"

"                 }"
"               }"
"             }"


"             : boxed_column { width=80; alignment = left;"
"               : row {"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"accept\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"               }"
"             }"

"           }"
          )
        (write-line x des2)
      )
      (not (setq des2 (close des2)))
      (< 0 (setq dch2 (load_dialog dcl2)))
      (new_dialog "pass" dch2)
      (princ "Tab 2 Loaded")
    )
;;End of DCL pop up box definition
    (progn

;;makes a pop-up list box

      (action_tile "Tab1"   "(Tab1)(done_dialog 1)")
      (action_tile "Tab3"   "(Tab3)(done_dialog 1)")
      (action_tile "Tab4"   "(Tab4)(done_dialog 1)")
      (action_tile "accept" "(done_dialog 1)")
      (action_tile "cancel" "(done_dialog 0)")

      (start_dialog)
    ) ;;end of DCL2 'and' above
    (princ "\nError. Unable to load dialogue box.")
  ) ;;end of DCL2 'if' above
  (vl-file-delete dcl2) ;;delete the temp DCL file
  ) ; end defun tab 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;






;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Tab3 ( / dcl3 des3 dch3 x)
  (if
    (and
      (setq dcl3 (strcat (getvar "TEMPPREFIX") "DCLTab3.dc3"))
      (setq des3 (open dcl3 "w"))
      (foreach x
        '(
"           pass : dialog"
"           {"
"             key = \"Lispdialoguebox\";"
"             label = \"The popped away again\";"
"             spacer;"

"             : column { width=80;"
"                 : row {"
"                   : button { key = \"Tab1\"; label = \"Tab1\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab2\"; label = \"Tab2\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab3\"; label = \"Tab3\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab4\"; label = \"Tab4\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   spacer;"
"                 }"
"             }"

"             : boxed_column { width=80; label = \"A TITLE HERE 'Tab 3'\";"
"               : row { width=80; alignment = centered;"
"                 : column {width = 20; alignment = centered;"

"                   :row {alignment = bottom;"
"                     : text { key = \"text1-a\"; label = \"Now your talking, Tab 3!!\"; width = 20; alignment = right;}"
"                   }"
"                   : row {width = 40; alignment = left;"
"                     : text { key = \"text1-b\"; label = \"good this,\"; width = 20; alignment = right;}"
"                   }"

"                 }"
"               }"
"             }"


"             : boxed_column { width=80; alignment = left;"
"               : row {"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"accept\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"               }"
"             }"

"           }"
          )
        (write-line x des3)
      )
      (not (setq des3 (close des3)))
      (< 0 (setq dch3 (load_dialog dcl3)))
      (princ "Tab 3 Loaded")
      (new_dialog "pass" dch3)
    )
;;End of DCL pop up box definition
    (progn

;;makes a pop-up list box

      (action_tile "Tab1"   "(Tab1)(done_dialog 1)")
      (action_tile "Tab2"   "(Tab2)(done_dialog 1)")
      (action_tile "Tab4"   "(Tab4)(done_dialog 1)")
      (action_tile "accept" "(done_dialog 1)")
      (action_tile "cancel" "(done_dialog 0)")

      (start_dialog)
    ) ;;end of DCL3 'and' above
    (princ "\nError. Unable to load dialogue box.")
  ) ;;end of DCL3 'if' above
  (vl-file-delete dcl3) ;;delete the temp DCL file
  ) ; end defun tab 3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;






;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Tab4 ( / dcl4 des4 dch4 x)
  (if
    (and
      (setq dcl4 (strcat (getvar "TEMPPREFIX") "DCLTab4.dcl"))
      (setq des4 (open dcl4 "w"))
      (foreach x
        '(
"           pass : dialog"
"           {"
"             key = \"Lispdialoguebox\";"
"             label = \"This is Tab 4 by the way\";"
"             spacer;"

"             : column { width=80;"
"                 : row {"
"                   : button { key = \"Tab1\"; label = \"Tab1\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab2\"; label = \"Tab2\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab3\"; label = \"Tab3\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab4\"; label = \"Tab4\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   spacer;"
"                 }"
"             }"

"             : boxed_column { width=80; label = \"A TITLE HERE 'Tab 4'\";"
"               : row { width=80; alignment = centered;"
"                 : column {width = 20; alignment = centered;"

"                   :row {alignment = bottom;"
"                     : text { key = \"text1-a\"; label = \"Look who'se talkng!!\"; width = 20; alignment = right;}"
"                   }"
"                   : row {width = 40; alignment = left;"
"                     : text { key = \"text1-b\"; label = \"to you. Anopther Tab!!\"; width = 20; alignment = right;}"
"                   }"

"                 }"
"               }"
"             }"


"             : boxed_column { width=80; alignment = left;"
"               : row {"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"accept\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"               }"
"             }"

"           }"
          )
        (write-line x des4)
      )
      (not (setq des4 (close des4)))
      (< 0 (setq dch4 (load_dialog dcl4)))
      (princ "Tab 4 Loaded")
      (new_dialog "pass" dch4)
    )
;;End of DCL pop up box definition
    (progn

;;makes a pop-up list box

      (action_tile "Tab1"   "(Tab1)(term_dialog)(done_dialog 1)")
      (action_tile "Tab2"   "(Tab2)(term_dialog)(done_dialog 1)")
      (action_tile "Tab3"   "(Tab3)(term_dialog)(done_dialog 1)")
      (action_tile "accept" "(done_dialog 1)(term_dialog)")
      (action_tile "cancel" "(done_dialog 0)(term_dialog)")

      (start_dialog)
    ) ;;end of DCL4 'and' above
    (princ "\nError. Unable to load dialogue box.")
  ) ;;end of DCL4 'if' above
  (vl-file-delete dcl4) ;;delete the temp DCL file
  ) ; end defun tab 4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Tab1)

  (princ)

)

 

Posted

I dont do it use child dcl but if temporary close a dcl the main thing would be to save all the relevant variable values, so when reopen can set them back again. You can call defuns as part of a "action tile" so would have all the get action tiles in a defun much easier to work out what is going on.

  • Like 1
Posted

I don't nest them much either, but without installing and using something like OpenDCL this is the best way for the OP to get near what they want using plain LISP and DCL I think though not as nice looking

Posted

Not sure why you are going 8 child deep I have 17 buttons each has 1 child. BOLT STEEL GRADE SIZE LENGTH  would be 4 deep but would be better done with a better dcl.

Posted
8 hours ago, BIGAL said:

Not sure why you are going 8 child deep I have 17 buttons each has 1 child. BOLT STEEL GRADE SIZE LENGTH  would be 4 deep but would be better done with a better dcl.

 

8 Children is the limit by AutoCAD. I saved my example away but changed it to close the first and open a new one, getting rid of the children thing

Posted

Coming back to this one again, this version uses the same idea I had above but closes each dialogue box and opens a new one which gets past the 8 children problem

 

There are 4 defuns in this, one for each tab (create more or less as you want), and currently they return the variable 'MyTab'. If you want to keep any variables entered into a dialogue I would have 'MyTab' as a list, the first item being the selected next tab to go to, and after that include in the list all the other variables, perhaps for the full dialogue box, and update that as the user selects controls. Am sure you can work out passing numbers backwards and forwards and repopulating the dialogue boxes with that.

 

 

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (defun Tab1 ( / dcl1 des1 dch1 x MyTab)
;;;DCL 1 ;;DCL on the fly: Ideas by Lee Mac and Cadtutor forums
;;create DCL pop up box
  (if
    (and
      (setq dcl1 (strcat (getvar "TEMPPREFIX") "DCLTab1.dcl"))
      (setq des1 (open dcl1 "w"))
      (foreach x
        '(
"           pass : dialog"
"           {"
"             key = \"Lispdialoguebox\";"
"             label = \"A Dialogue Box\";"
"             spacer;"

"             : column { width=80;"
"                 : row {"
"                   : button { key = \"Tab1\"; label = \"Tab1\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab2\"; label = \"Tab2\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab3\"; label = \"Tab3\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab4\"; label = \"Tab4\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   spacer;"
"                 }"
"             }"

"             : boxed_column { width=80; label = \"A TITLE HERE 'Tab 1'\";"
"               : row { width=80; alignment = centered;"
"                 : column {width = 20; alignment = centered;"

"                   :row {alignment = bottom;"
"                     : text { key = \"text1-a\"; label = \"Lets Make  DCL!\"; width = 20; alignment = right;}"
"                   }"
"                   : row {width = 40; alignment = left;"
"                     : text { key = \"text1-b\"; label = \"and put all the fun bits here\"; width = 20; alignment = right;}"
"                   }"

"                 }"
"               }"
"             }"


"             : boxed_column { width=80; alignment = left;"
"               : row {"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"accept\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"               }"
"             }"

"           }"
          )
        (write-line x des1)
      )
      (not (setq des1 (close des1)))
      (< 0 (setq dch1 (load_dialog dcl1)))
      (new_dialog "pass" dch1)
    )
;;End of DCL pop up box definition
    (progn

;;makes a pop-up list box

      (action_tile "Tab1"   "(Setq MyTab \"Tab1\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab2"   "(Setq MyTab \"Tab2\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab3"   "(Setq MyTab \"Tab3\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab4"   "(Setq MyTab \"Tab4\")(term_dialog)(done_dialog 1)")
      (action_tile "accept" "(done_dialog 1)(term_dialog)")
      (action_tile "cancel" "(done_dialog 0)(term_dialog)")

      (start_dialog)
    ) ;;end of DCL1 'and' above
    (princ "\nError. Unable to load dialogue box.")
  ) ;;end of DCL1 'if' above
  (vl-file-delete dcl1) ;;delete the temp DCL file
  MyTab
  ) ; end defun tab 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Tab2 ( / dcl2 des2 dch2 x MyTab)

  (if
    (and
      (setq dcl2 (strcat (getvar "TEMPPREFIX") "DCLTab2.dcl"))
      (setq des2 (open dcl2 "w"))
      (foreach x
        '(
"           pass : dialog"
"           {"
"             key = \"Lispdialoguebox\";"
"             label = \"Popped Up to say Hello\";"
"             spacer;"

"             : column { width=80;"
"                 : row {"
"                   : button { key = \"Tab1\"; label = \"Tab1\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab2\"; label = \"Tab2\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab3\"; label = \"Tab3\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab4\"; label = \"Tab4\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   spacer;"
"                 }"
"             }"

"             : boxed_column { width=80; label = \"A TITLE HERE 'Tab 2'\";"
"               : row { width=80; alignment = centered;"
"                 : column {width = 20; alignment = centered;"

"                   :row {alignment = bottom;"
"                     : text { key = \"text1-a\"; label = \"Aha!! Tab 2!!\"; width = 20; alignment = right;}"
"                   }"
"                   : row {width = 40; alignment = left;"
"                     : text { key = \"text1-b\"; label = \"put more fun bits here\"; width = 20; alignment = right;}"
"                   }"

"                 }"
"               }"
"             }"


"             : boxed_column { width=80; alignment = left;"
"               : row {"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"accept\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"               }"
"             }"

"           }"
          )
        (write-line x des2)
      )
      (not (setq des2 (close des2)))
      (< 0 (setq dch2 (load_dialog dcl2)))
      (new_dialog "pass" dch2)
      (princ "Tab 2 Loaded")
    )
;;End of DCL pop up box definition
    (progn

;;makes a pop-up list box

      (action_tile "Tab1"   "(Setq MyTab \"Tab1\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab2"   "(Setq MyTab \"Tab2\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab3"   "(Setq MyTab \"Tab3\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab4"   "(Setq MyTab \"Tab4\")(term_dialog)(done_dialog 1)")
      (action_tile "accept" "(done_dialog 1)(term_dialog)")
      (action_tile "cancel" "(done_dialog 0)(term_dialog)")

      (start_dialog)
    ) ;;end of DCL2 'and' above
    (princ "\nError. Unable to load dialogue box.")
  ) ;;end of DCL2 'if' above
  (vl-file-delete dcl2) ;;delete the temp DCL file
  MyTab
  ) ; end defun tab 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;






;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Tab3 ( / dcl3 des3 dch3 x MyTab)
  (if
    (and
      (setq dcl3 (strcat (getvar "TEMPPREFIX") "DCLTab3.dc3"))
      (setq des3 (open dcl3 "w"))
      (foreach x
        '(
"           pass : dialog"
"           {"
"             key = \"Lispdialoguebox\";"
"             label = \"The popped away again\";"
"             spacer;"

"             : column { width=80;"
"                 : row {"
"                   : button { key = \"Tab1\"; label = \"Tab1\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab2\"; label = \"Tab2\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab3\"; label = \"Tab3\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab4\"; label = \"Tab4\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   spacer;"
"                 }"
"             }"

"             : boxed_column { width=80; label = \"A TITLE HERE 'Tab 3'\";"
"               : row { width=80; alignment = centered;"
"                 : column {width = 20; alignment = centered;"

"                   :row {alignment = bottom;"
"                     : text { key = \"text1-a\"; label = \"Now your talking, Tab 3!!\"; width = 20; alignment = right;}"
"                   }"
"                   : row {width = 40; alignment = left;"
"                     : text { key = \"text1-b\"; label = \"good this,\"; width = 20; alignment = right;}"
"                   }"

"                 }"
"               }"
"             }"


"             : boxed_column { width=80; alignment = left;"
"               : row {"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"accept\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"               }"
"             }"

"           }"
          )
        (write-line x des3)
      )
      (not (setq des3 (close des3)))
      (< 0 (setq dch3 (load_dialog dcl3)))
      (princ "Tab 3 Loaded")
      (new_dialog "pass" dch3)
    )
;;End of DCL pop up box definition
    (progn

;;makes a pop-up list box

      (action_tile "Tab1"   "(Setq MyTab \"Tab1\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab2"   "(Setq MyTab \"Tab2\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab3"   "(Setq MyTab \"Tab3\")(term_dialog)(done_dialog 1)")
      (action_tile "Tab4"   "(Setq MyTab \"Tab4\")(term_dialog)(done_dialog 1)")
      (action_tile "accept" "(done_dialog 1)(term_dialog)")
      (action_tile "cancel" "(done_dialog 0)(term_dialog)")

      (start_dialog)
    ) ;;end of DCL3 'and' above
    (princ "\nError. Unable to load dialogue box.")
  ) ;;end of DCL3 'if' above
  (vl-file-delete dcl3) ;;delete the temp DCL file
  MyTab
  ) ; end defun tab 3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;






;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Tab4 ( / dcl4 des4 dch4 x MyTab)
  (if
    (and
      (setq dcl4 (strcat (getvar "TEMPPREFIX") "DCLTab4.dcl"))
      (setq des4 (open dcl4 "w"))
      (foreach x
        '(
"           pass : dialog"
"           {"
"             key = \"Lispdialoguebox\";"
"             label = \"This is Tab 4 by the way\";"
"             spacer;"

"             : column { width=80;"
"                 : row {"
"                   : button { key = \"Tab1\"; label = \"Tab1\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab2\"; label = \"Tab2\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab3\"; label = \"Tab3\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   : button { key = \"Tab4\"; label = \"Tab4\"; is_default = false; is_cancel = true; fixed_width = true; width = 20;}"
"                   spacer;"
"                 }"
"             }"

"             : boxed_column { width=80; label = \"A TITLE HERE 'Tab 4'\";"
"               : row { width=80; alignment = centered;"
"                 : column {width = 20; alignment = centered;"

"                   :row {alignment = bottom;"
"                     : text { key = \"text1-a\"; label = \"Look who'se talkng!!\"; width = 20; alignment = right;}"
"                   }"
"                   : row {width = 40; alignment = left;"
"                     : text { key = \"text1-b\"; label = \"to you. Anopther Tab!!\"; width = 20; alignment = right;}"
"                   }"

"                 }"
"               }"
"             }"


"             : boxed_column { width=80; alignment = left;"
"               : row {"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"accept\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"                 : column {width = 18; alignment = centered;"
"                   : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 15; }"
"                 }"
"               }"
"             }"

"           }"
          )
        (write-line x des4)
      )
      (not (setq des4 (close des4)))
      (< 0 (setq dch4 (load_dialog dcl4)))
      (princ "Tab 4 Loaded")
      (new_dialog "pass" dch4)
    )
;;End of DCL pop up box definition
    (progn

;;makes a pop-up list box

      (action_tile "Tab1"   "(Setq MyTab \"Tab1\")(done_dialog 1)")
      (action_tile "Tab2"   "(Setq MyTab \"Tab2\")(done_dialog 1)")
      (action_tile "Tab3"   "(Setq MyTab \"Tab3\")(done_dialog 1)")
      (action_tile "Tab4"   "(Setq MyTab \"Tab4\")(done_dialog 1)")
      (action_tile "accept" "(done_dialog 1)")
      (action_tile "cancel" "(done_dialog 0)")

      (start_dialog)
    ) ;;end of DCL4 'and' above
    (princ "\nError. Unable to load dialogue box.")
  ) ;;end of DCL4 'if' above
  (vl-file-delete dcl4) ;;delete the temp DCL file
  MyTab ;;change this to a list with all variables in it. Repopulate tab when it is opened again
  ) ; end defun tab 4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(defun c:testthis ( / )
  (setq MyTab (Tab1))
  (setq Done "Not")
  (while (= Done "Not")
    (if (= MyTab nil)(setq Done "Yes"))
    (if (/= MyTab nil)(setq MyTab (eval (read (strcat "(" MyTab ")"))) )
    )
  ); end while

 

  • Like 2
Posted

Thanks Steve.

Fiend of mine ask why I was trying such a big task as a Project Manager for my first lisp routine?

Told him, I wrote few small lisp routines, but it a challenge and no one is done this type of lisp routine!!

After 40 years of working with AutoCAD and creating scripts and modifying some lisp routines, I wanted to create my own PM lisp routine fore years.

Never had the time.  Now I have some time between work projects I am working on this lisp routine with some help!

Thanks again for your help. I might need some feel back once I finish the lisp routine!

  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...