woodman78 Posted May 5, 2011 Posted May 5, 2011 I have this lisp which works fine if I am inserting blocks without attribs but when I select a number of blocks to insert that have attribs it goes doesn't gie me the option to input attrib info at the command line. When I select the insertion point for the first block the command line jumps straight to insertion point for the second block without prompting for attrib info and then inserts only the first block. Do i need to pause the insert command or something like that? drlegend : dialog { //*dialog name label = "Drainage Pipes Legend"; //*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 Legend Item:"; //*give it a label : list_box { //*define popup_list key = "S1"; //*give it a name width=70; //*edit_width fixed_width=true; //*fixed width height=30; //*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 = "NNRDO v1.0.24.07.2009"; //*some more text } //*end text } //*end paragraph } //*end column } //*end row } //*end dialog (defun c:drlegend (/ *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 '("*** Existing ***" ;0 "Existing Storm Sewer" ;1 "Existing Storm Sewer PVC" ;2 "Existing Storm Sewer to be removed" ;3 "Existing Concrete Storm Sewer to be Replaced Type 1" ;4 "Existing Concrete Storm Sewer to be Replaced Type 2" ;5 "Existing Concrete Storm Sewer to be Replaced Type 3" ;6 "Existing Concrete Storm Sewer to be Replaced Type 4" ;7 "Existing PVC Storm Sewer to be Replaced with Concrete Type 1" ;8 "Existing PVC Storm Sewer to be Replaced with Concrete Type 2" ;9 "Existing PVC Storm Sewer to be Replaced with Concrete Type 3" ;10 "Existing PVC Storm Sewer to be Replaced with Concrete Type 4" ;11 "Existing Filter Drain" ;12 "Existing Foul Sewer" ;13 "Existing Foul Sewer to be removed" ;14 "Existing Foul Sewer PVC" ;15 "Existing Foul Sewer Pumped PVC" ;16 "--------------------------------------" ;17 "*** Proposed ***" ;18 "Proposed Concrete Storm Sewer Type 1" ;19 "Proposed Concrete Storm Sewer Type 2" ;20 "Proposed Concrete Storm Sewer Type 3" ;21 "Proposed Concrete Storm Sewer Type 4" ;22 "Proposed Thermoplastic Integrally Socketed Carrier Drain Type 1" ;23 "Proposed Thermoplastic Integrally Socketed Carrier Drain Type 2" ;24 "Proposed Thermoplastic Integrally Socketed Carrier Drain Type 3" ;25 "Proposed Thermoplastic Integrally Socketed Carrier Drain Type 4" ;26 "Proposed Half Perf Thermoplastic Filter Drain with Geotextile to Top Face Type A" ;27 "Proposed Half Perf Thermoplastic Filter Drain with Geotextile to Top Face Type B" ;28 "Proposed Half Perf Thermoplastic Filter Drain with Geotextile to Top Face Type C" ;29 "Proposed Half Perf Thermoplastic Filter Drain with Geotextile to Top Face Type D" ;30 "Proposed Half Perforated Thermoplastic Filter Drain Type 1" ;31 "Proposed Half Perforated Thermoplastic Filter Drain Type 2" ;32 "Proposed Half Perforated Thermoplastic Filter Drain Type 3" ;33 "Proposed Half Perforated Thermoplastic Filter Drain Type 4" ;34 "Proposed Ductile Iron Storm Sewer Type 1" ;35 "Proposed Ductile Iron Storm Sewer Type 2" ;36 "Proposed Ductile Iron Storm Sewer Type 3" ;37 "Proposed Ductile Iron Storm Sewer Type 4" ;38 "Proposed Foul Sewer Type 1" ;39 "Proposed Foul Sewer Type 2" ;40 "Proposed Foul Sewer Type 3" ;41 "Proposed Foul Sewer Type 4" ;42 ) ) (setq vl '("CMDECHO" "CLAYER" "OSMODE") ov (mapcar 'getvar vl)) (cond ( (<= (setq dcHandle (load_dialog "drlegend.dcl")) 0) (princ "\n** Dialog file not Found **")) ( (not (new_dialog "drlegend" 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 17 18)) (alert \"Invalid Item\")) ((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_Legend") (entmake (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 "CCC_SHEET_LAYOUT_Legend") (cons 70 0) (cons 62 7) (cons 370 30)))) (mapcar 'setvar vl '(0 "CCC_SHEET_LAYOUT_Legend" 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) (mapcar 'setvar vl ov) (princ)) Quote
SLW210 Posted May 5, 2011 Posted May 5, 2011 Unless mode is set to "Verify" you will NOT be prompted for attribute value on an insert. Quote
SLW210 Posted May 5, 2011 Posted May 5, 2011 BATTMAN>Select attribute>Edit>Mode>Verify is how it is done manually, not sure about LISP method. Quote
alanjt Posted May 6, 2011 Posted May 6, 2011 You have to set the ATTDIA system variable. Controls whether INSERT uses default attribute settings during insertion of blocks. 0 Assumes the defaults for the values of all attributes 1 Turns on prompts or a dialog box for attribute values, as specified by ATTDIA Quote
woodman78 Posted May 9, 2011 Author Posted May 9, 2011 Thanks everyone ATTDIA works. One thing though. As I would be inserting blocks for creating legends in drawings the attrib has the same name. After inserting the first block can the dialog box preview the attrib entry for the next block without having to type it again from scratch. Quote
Recommended Posts
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.