Jump to content

Recommended Posts

Posted

Hi,I am using in a lot of lisp code this part of a code to select Model or Paper Space

 

; Model or Paper Space
			  
          (initget "1 2")
          (setq t_spc (cond ( (getkword "\nSelect Space : ? [1.Modelspace/2.Paperspace] <1>")) ("1"))
          )
          (if (and (= tm 1) (= t_spc "2")) (setvar 'tilemode 0))

 

I want to update the code and in a dcl menu add toggle Model space and Paper Space to select it from the beginning

 

So I write this part of DCL

 

                  "  : boxed_column { label = \"Select Space\"; height = 1.0;"
                  "    : row"
                  "    {"
                  "      : toggle { height = 1.0; width = 25; is_tab_stop = true;"
                  "        key = \"Model\"; label = \"Model Space\";"
                  "      }"
                  "      : toggle { height = 1.0; width = 25; is_tab_stop = true;"
                  "        key = \"Paper\"; label = \"Paper Space:\";"
                  "      }"
                  "    }"
                  "  }"

 

How to update the lisp code to work with the dcl. Most of the time I do this change before inset a table in the drawing , to choose the Model or the paper space

 

Thanks

 

Posted

Have you tried action_tile? Give it the button key and the command (in quotes). If that doesn't work, tell us what else you tried.

Posted

The action_tile will sell the space after ok. I want to do the change in specific part of the code!! I don't know how to do it!!!

 

Thanks

Posted

Use Radio buttons in a Boxed_radio_buttons. The advantage over toggles is that only 1 button can be activated. In the Multi radio buttons.lsp change the MKtemp to a file name with path, then use 

(setq ans (ah:butts 1 "V"   '("Choose space  " "Model" "Pspace" ))) 	; ans holds the button picked value as a string

Multi radio buttons.lsp

It will write the dcl code for you.

 

 

Posted

Are you wanting to switch model space - paper space part way through the routine and still have the DCL box open? Not sure but you might need to close the DCL box, switch, and then open the DCL box again - I'd have to check that though

Posted

Hi  Steven P. I use this part of the code to switch from model to paper space … most of the time before insert a table with coordinates (to have the option Model or Paper Space)

 

; Model or Paper Space
			  
          (initget "1 2")
          (setq t_spc (cond ( (getkword "\nSelect Space : ? [1.Modelspace/2.Paperspace] <1>")) ("1"))
          )
          (if (and (= tm 1) (= t_spc "2")) (setvar 'tilemode 0))

 

I was thinking  the selection 1 or 2  to preset it in a dcl menu with some other setting before the ok button with a part of code like

 

                  "  : boxed_column { label = \"Select Space\"; height = 1.0;"
                  "    : row"
                  "    {"
                  "      : toggle { height = 1.0; width = 25; is_tab_stop = true;"
                  "        key = \"Model\"; label = \"Model Space\";"
                  "      }"
                  "      : toggle { height = 1.0; width = 25; is_tab_stop = true;"
                  "        key = \"Paper\"; label = \"Paper Space:\";"
                  "      }"
                  "    }"
                  "  }"

 

To select from the beginning, the 1 or 2 with action_tile perhaps and maybe the lisp code be something like 

 (if (and (= tm 1) (= t_spc "2")) (setvar 'tilemode 0))

 

Is this possible?

 

Thanks

 

 

Posted

Here is the pop dcl code, thanks to rlx convert dcl 2 lsp.

 

(setq dcl (vl-filename-mktemp nil nil ".dcl") )
(setq des (open dcl "w") )
(progn
(foreach x 
'(
"AHbutts : dialog 	{"
"	label =\"Choose space  \" ;"
"	: row	{"
"	: boxed_radio_column 	{"
" width = 24 ;"
"	: radio_button	{"
"key = \"Rb1\";"
"label = \"Model\";"
"	}"
"spacer_1 ;"
"	: radio_button	{"
"key = \"Rb2\";"
"label = \"Pspace\";"
"	}"
"spacer_1 ;"
"	}"
"	}"
"spacer_1 ;"
"	ok_only;"
"	}"
)
(write-line x des )
); foreach
T
); progn
(not (setq des (close des)) )
(setq dch (load_dialog dcl) )
(new_dialog "test" dch )
(= 1 (setq dcf (start_dialog)) )
); and
(*error* null )
(princ )
); defun

 

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...