I have taken a different approach to this now. I have created blocks with leaders and the specific text I want but how do I get this lisp that LeeMac helped me with to explode the blocks on input? I have researched that I need to put star before the name but how do I do this when I can select multiple blocks?
Code:
insert_lining_leaders : dialog { //*dialog name
label = "Lining Leaders"; //*give it a label
: row { //*define row
: paragraph { //*define paragraph
} //*end paragraph
} //*end row
: row { //*define row
: boxed_column { //*define boxex_column
label = "Choose a Note:"; //*give it a label
: list_box { //*define popup_list
key = "S1"; //*give it a name
width=100; //*edit_width
fixed_width=true; //*fixed width
height=20; //*Height
fixed_height=true; //*fixed height
alignment = right; //*alignment
multiple_select=true;
} //*end popup_list
: spacer { //*define spacer
height = 0; //*height
} //*end spacer
} //*end boxed_column
} //*end row
: row { //*define row
: column { //*define column
ok_cancel ; //*predifined OK/Cancel
: paragraph { //*define paragraph
: text_part { //*define more text
label = "CCC NNRDO v1.0.24.07.2009"; //*some more text
} //*end text
} //*end paragraph
} //*end column
} //*end row
} //*end dialog
Code:
(defun c:insert_lining_leaders (/ *error* DCHANDLE INPT OV PT RTN S1_LIST VL SUSM)
(setq SUSM (getvar "osmode"))
(defun *error* (msg)
(and dcHandle (unload_dialog dcHandle))
(and ov (mapcar 'setvar vl ov))
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **")))
(princ))
(setq S1_list
'("*** Smybols ***" ;0
"M115 Yield Triangle" ;1
)
)
(setq vl '("CMDECHO" "CLAYER" "OSMODE") ov (mapcar 'getvar vl))
(setvar "attdia" 1)
(cond ( (<= (setq dcHandle (load_dialog "insert_lining_leaders.dcl")) 0)
(princ "\n** Dialog file not Found **"))
( (not (new_dialog "insert_lining_leaders" dcHandle))
(princ "\n** Dialog Definition Not Found **"))
(t
(start_list "S1")
(mapcar (function add_list) S1_list)
(end_list)
(set_tile "S1" (setq *def* (cond (*def*) ("1"))))
(action_tile "S1" "(setq *def* $value)")
(action_tile "accept" "(cond ((member (atoi *def*) '(0)) (alert \"Invalid Note\"))
((done_dialog 1)))")
(action_tile "cancel" "(done_dialog 0)")
(setq rtn (start_dialog))
(setq dcHandle (unload_dialog dcHandle))
(if (= 1 rtn)
(progn
(or (tblsearch "LAYER" "CCC_SHEET_LAYOUT_Notes")
(entmake (list (cons 0 "LAYER")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbLayerTableRecord")
(cons 2 "CCC_SHEET_LAYOUT_Notes")
(cons 70 0)
(cons 62 7)
(cons 370 30))))
(mapcar 'setvar vl '(0 "CCC_SHEET_LAYOUT_Notes" 0))
(foreach block (mapcar
(function
(lambda (x) (nth x S1_list)))
(read (strcat "(" *def* ")")))
(setvar "osmode" 1)
(if (setq pt (setq INPT (getpoint "\nPick Insertion Point: ")))
(command "_.-insert" block INPT "1" "1" "0"))))
(princ "\n*Cancel*"))))
(setvar "osmode" SUSM)
(setvar "attdia" 0)
(mapcar 'setvar vl ov)
(princ))
Bookmarks