DCL

DCL

Anonymous
Not applicable
693 Views
1 Reply
Message 1 of 2

DCL

Anonymous
Not applicable
(defun c:ss ()

 (defun title_dflt ()
   (if (= typ nil) (setq typ "t"))
   (if (= name nil) (setq name "Drawing Name"))
   (if name (set_tile "name" name))
   (if (= scale nil) (setq scale "Scale: 1/8\" = 1'-0\""))
   (if scale (set_tile "scale" scale))

   (if (= typ "t") (set_tile "rb1" "1"))
   (if (= typ "d") (set_tile "rb2" "1"))
   (if (= typ "s") (set_tile "rb3" "1"))
 ); title_dflt

 (title_set)
  (if
    (setq p1 (getpoint "\nSpecify insertion point: "))
      (progn
	(cond
	  ((= typ "t") 
	   (command "-insert" "YOUR_BLOCK_NAME" "_none" p1 "" "" "" name scale)
	  )
	  ((= typ "d") 
	   (command "-insert" "YOUR_BLOCK_NAME" "_none" p1 "" "" "" name scale)
	  )
	  ((= typ "s") 
	   (command "-insert" "YOUR_BLOCK_NAME" "_none" p1 "" "" "" name scale)
	  )
	); cond
      ); progn
  ); if
 (princ)
); ss

 (defun title_set ()
   (setq dcl_id (load_dialog "ss.dcl"))
    (if (not (new_dialog "ss" dcl_id))
     (exit)
 )

 (title_dflt)
   (action_tile "rb1" "(setq typ \"t\")")
   (action_tile "rb2" "(setq typ \"d\")")
   (action_tile "rb3" "(setq typ \"s\")")
   (action_tile "name" "(setq name $value)")
   (action_tile "scale" "(setq scale $value)")
   (action_tile "accept" "(done_dialog)")
   (action_tile "cancel" "(exit)")
    (start_dialog)
     (unload_dialog dcl_id)
      (princ)
 ); title_set
(princ)
ss : dialog {
	 label = "Drawing Title";
  spacer;       

	: boxed_radio_row {
	  label = "Block Type:";

	  : radio_button {
	    label = "&Title";
	    key = "rb1";
	  }
	  : radio_button {
	    label = "&Detail";
	    key = "rb2";
	  }
	  : radio_button {
	    label = "&Section";
	    key = "rb3";
	  }
	} // end boxed_radio_row
  spacer;

	: boxed_column {
	  label = "Drawing:";

	  : edit_box {
	    label = "Name:";
	    key = "name";
	    edit_width = 30;
	    mnemonic = "T";
	    allow_accept = true;
	  }
	  : edit_box {
	    label = "Scale:";
	    key = "scale" ;
	    edit_width = 30 ;
	    mnemonic = "T" ;
	    allow_accept = true ;
	  }
	} // end boxed_column
  spacer;

  ok_cancel;
} // end dialog





HOW I CAN CHANGE THE LISP BUTTON INSTEAD OF RADIO BUTTON
MY VIEW EACH BLOCK WILL BE INSERT BY EACH BUTTON WHICH HAVE SAME BLOCK NAME

ANY ONE HELP ME



0 Likes
694 Views
1 Reply
Reply (1)
Message 2 of 2

scot-65
Advisor
Advisor
Two items:

a) Assign a key to the radio box container: key="rb0";
Remove all three action tiles to the radio buttons.
In your title default you can (set_tile "rb0" "rb1") and remove all the extra code.

b) Action tile assigned to an edit box will have unexpected results.
Remove both action tiles for the edit boxes.

Revise action_tile "accept" as follows:
(action_tile "accept" "(MyProgram_GET)(done_dialog 1)")
where
(defun MyProgram_GET ()
(setq MyValues (list
(get_tile "rb0")
(get_tile "name")
(get_tile "scale")
))
);end MyProgram_GET

Explanation: Users will commit to what is shown in the dialog
by pressing the OK button. It is at this time that one gathers
all the information to move onto the next part of the utility.

Finally, see what you have: (princ MyProgram_GET)

Unexpected behavior is also possible when calls to a function/subroutine
is above the function/subroutine block of code. For the example above,
place the defun above new_dialog (and not in between new dialog and
start dialog -AND- not below start dialog).

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes