DCL/LISP to insert block at 0,0 and explode according to multiple radio options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I am trying to create a dcl and lisp for inserting title blocks. We have many and I am trying to simplify the process.
I have created a dcl that will let you pick the size, logo and orientation of the title block. I would then like the user to press ok and the corresponding title block to those options be inserted at 0,0 and then exploded, (we xref our title blocks, so I don't want it to remain a block once inserted.)
The problem is, I have no clue where to start with the lisp portion of the project. I would imagine I need to create a list of selected options and then insert a block according to that list, but I have no clue how to do that. Any help would be greatly appreciated. The DCL and LISP I have are below. The lisp now pretty much just runs the dcl and that's about it.
tb : dialog {
label = "Title Block Utility";
: text {
label = "Version 1.0 : May 2022 : NWT";
}
: row {
: column {
: radio_column {
label = "Size";
key = "s1";
: radio_button {
key = "s2";
label = "8.5 x 11";
}
: radio_button {
key = "s3";
label = "11 x 17";
}
: radio_button {
key = "s4";
label = "22 x 34";
}
: radio_button {
key = "s5";
label = "24 x 36";
}
: radio_button {
key = "s6";
label = "30 x 42";
}
}
}
: column {
: radio_column {
label = "Logo";
key = "l1";
: radio_button {
key = "l2";
label = "CESO";
}
: radio_button {
key = "l3";
label = "CESO Arch";
}
: radio_button {
key = "l4";
label = "Arch of Note";
}
}
}
: column {
: radio_column {
label = "Orientation";
key = "o1";
: radio_button {
key = "02";
label = "Landscape";
}
: radio_button {
key = "03";
label = "Portrait";
}
}
}
}
: boxed_row {
: button {
key = "accept";
label = " Okay ";
is_default = true;
}
: button {
key = "cancel";
label = " Cancel ";
is_default = false;
is_cancel = true;
}
}
}
(defun C:tb()
(if(not(setq dcl_id (load_dialog "tb.dcl")))
(progn
(alert "The DCL file could not be loaded!")
(exit)
)
(progn
(if (not(new_dialog "tb" dcl_id))
(progn
(alert "The tb definition could not be loaded!")
(exit)
)
(progn
(action_tile "accept" "(saveVars)(done_dialog 2)")
(action_tile "cancel" "(done_dialog 1)")
(setq ddiag(start_dialog))
(unload_dialog dcl_id)
(if(= ddiag 1)
(princ "\n TITLEBLOCK cancelled!")
)
(if(= ddiag 2)
(progn
(princ "\n The user pressed Okay!")
)
)
)
)
)
)
(princ)
)