Originally Posted by
rbdome
SSX prompts me to enter the block name; I would rather visually pick it from the list in the QSELECT Dialog.
If you start SSX, pick a block, and hit enter you've selected every block with that name. I've got a lot of blocks in my drawings and only remember the names of a few of them.
I've written lisp for selecting an item from an AutoCAD table so a modified version shouldn't be that bad. I'm busy today, but if you ask a moderator would move this thread to the lisp forum I'll post one first of next week if nobody beats me to it.
Sub-routine from another lisp for modifying Attrubutes if anyone wants to play with it:
Code:
;;;********** ChgProp from Table **********
(defun TblSel (TblType / TblLst Idx# txt)
(setq TblLst ()
x (tblnext TblType T)
)
(while x ; Build table
(if (/= (cdr (assoc 2 x)) "") ;if table entry isn't ""
(setq TblLst (cons (cdr (assoc 2 x)) TblLst)) ;add it to list.
);if
(setq x (tblnext TblType))
);while
(if (> (length TblLst) (getvar "MAXSORT"))
(setvar "MAXSORT" (+ 200 (length TblLst)))
); if
(setq TblLst (acad_strlsort TblLst)
Idx# (- (length TblLst)(length(member TblEnt TblLst)))
)
(if (= (getvar "cmddia") 0)
(progn
(foreach N TblLst (print N))
(setq txt(strcat "\nEnter " TblType " Name: "))
(while (not (member (setq TblNam (strcase (getstring txt)))TblLst))
(princ "\nThat is not a valid style: ")
); while
); progn
(progn
(setq id (load_dialog "chs.dcl"))
(new_dialog "chs" id)
(start_list "styles")
(mapcar 'add_list TblLst)
(end_list)
(set_tile "styles" (itoa Idx#))
(action_tile "styles" "(if $value(setq Idx# (atoi $value)))")
(mode_tile "styles" 0)
(mode_tile "styles" 2)
(start_dialog)
(done_dialog)
(setq TblNam (nth Idx# TblLst))
); progn
); if
); defun
Examples used to select layer or text style:
Code:
((= OP "Layer")
(progn
(setq TblSel (vla-get-Layers DocObj)
TblEnt ELA
)
(TblSel "Layer")
(vl-catch-all-apply 'vla-put-Layer (list EOBJ TblNam))
); progn
); Layer
((= OP "Style")
(progn
(setq TblSel (vla-get-TextStyles DocObj)
TblEnt (vlax-get-property EOBJ 'StyleName)
)
(TblSel "Style")
(vl-catch-all-apply 'vla-put-StyleName (list EOBJ TblNam))
); progn
); Style