flowerrobot Posted April 11, 2009 Share Posted April 11, 2009 Would you be so kind as to tell me where im stuffing up. I can not work it out for the life of me. I can not get one cell to update, "description" it needs to have a radio button on for it to work, but it refuses to update and "des" which is the same as the other 15 does not work either, (feel free to suggest better coding methods aswell) the .dcl file rev3 : dialog { label = "Revisions" ; :column { key = "revbox" ; :row { :column { : edit_box { label = "&Drawn by"; key = "Doneby"; edit_width = 4; } : edit_box { label = "&Revised by"; key = "revisedby"; edit_width = 4; } } :column { : edit_box { label = "&Dwg Checked by"; key = "ckd"; edit_width = 4; } : edit_box { label = "&Rev Checked by"; key = "ckd2"; edit_width = 4; } } :column { : edit_box { label = "&Designedby"; key = "des"; edit_width = 4; } : edit_box { label = "&Approved by"; key = "app"; edit_width = 4; } } :column { spacer; :row { spacer; : text_part { label = "Rev A";} } : edit_box { label = "&Date"; key = "Date"; edit_width = 4; } } } :boxed_radio_row { : radio_button {key = "ifc" ; label = "Issued For Construction"; is_default = true; } : radio_button {key = "ifi" ; label = "Issued For Information"; } : radio_button {key = "ifp" ; label = "Issued For Percurament"; } : radio_button {key = "Other" ; label = "other"; } } : edit_box { label = "&Revision Notes"; key = "Description"; edit_width = 90; } :row{ ok_cancel; spacer;spacer;spacer; : button { key = "reveep" ; label = "Rev up" ; is_default = true; width = true; alignment = center; } } :row { spacer; spacer; spacer; spacer; spacer; spacer; spacer; spacer; spacer; spacer; : text { label = "by Seth Ruhan Rev 1.00";} } } } (action_tile "des" "(setq attribute57 (get_tile \"des\"))") (action_tile "Description" "(setq attribute18 (get_tile \"Description\"))") revoptions.LSP Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted April 11, 2009 Share Posted April 11, 2009 The dialog did not appear. I made changes in both files and it appears now. I placed comments next to the changes. You got some work to do. rev3 : dialog { label = "Revisions" ; : column { // key = "revbox" ; // Problem on this line : row { : column { : edit_box { label = "&Drawn by"; key = "Doneby"; edit_width = 4; } : edit_box { label = "&Revised by"; key = "revisedby"; edit_width = 4; } } : column { : edit_box { label = "&Dwg Checked by"; key = "ckd"; edit_width = 4; } : edit_box { label = "&Rev Checked by"; key = "ckd2"; edit_width = 4; } } : column { : edit_box { label = "&Designedby"; key = "des"; edit_width = 4; } : edit_box { label = "&Approved by"; key = "app"; edit_width = 4; } } : column { spacer; : row { spacer; : text_part { label = "Rev A"; } } : edit_box { label = "&Date"; key = "Date"; edit_width = 4; } } } : boxed_radio_row { : radio_button { key = "ifc" ; label = "Issued For Construction"; is_default = true; } : radio_button { key = "ifi" ; label = "Issued For Information"; } : radio_button { key = "ifp" ; label = "Issued For Percurament"; } : radio_button { key = "Other" ; label = "other"; } } : edit_box { label = "&Revision Notes"; key = "Description"; edit_width = 90; } : row { ok_cancel; spacer;spacer;spacer; : button { key = "reveep" ; label = "Rev up" ; is_default = true; width = true; alignment = center; } } : row { spacer; spacer; spacer; spacer; spacer; spacer; spacer; spacer; spacer; spacer; : text { label = "by Seth Ruhan Rev 1.00"; } } } } Good Luck, The Buzzard Rev up.LSP Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted April 11, 2009 Share Posted April 11, 2009 I just noticed you edited your post before I could get back to you on the original. I will wait for your feed back. Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted April 11, 2009 Author Share Posted April 11, 2009 thank so much buzzard, will revise in the morning, thanks again Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 11, 2009 Share Posted April 11, 2009 Just a few pointers for ya - save you all that typing! Instead of: (setq en (ssname ss1 0)) (setq ed (entget en)) (setq edata (entget en)) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute1 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute2 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute3 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute4 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute5 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute6 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute7 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute8 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute9 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute10 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute11 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute12 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute13 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute14 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute15 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute16 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute17 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute18 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute19 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute20 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute21 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute22 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute23 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute23 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute25 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute26 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute27 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute28 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute29 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute30 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute31 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute31 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute33 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute34 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute35 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute36 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute37 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute38 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute39 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute40 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute41 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute42 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute43 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute44 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute45 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute46 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute47 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute48 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute49 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute50 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute51 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute52 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute53 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute54 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute56 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute57 (cdr (assoc 1 edata))) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (setq attribute58 (cdr (assoc 1 edata))) Why not make a list of attribute values using: (setq att (entnext (ssname ss1 0))) (while (not (eq "SEQEND" (cdadr (entget att)))) (setq attLst (cons (cdr (assoc 1 (entget att))) attLst) att (entnext att))) Just make sure that you localise the "attLst" variable, otherwise you will get duplicates Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted April 12, 2009 Author Share Posted April 12, 2009 lee, with that list, wouldnt i still need to assign each one their own entity, to update them and put them back?? or am i being ignorant? Sorry buzzard, i thought i fixed it, so i updated it, then i relised then two others wouldnt update, Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 12, 2009 Share Posted April 12, 2009 The above will create a list of all the attribute values, If I were you I would create an associative list of attribute tags and strings, making the updating part much easier, and less error prone. Make the list like this: (setq att (entnext (ssname ss1 0))) (while (not (eq "SEQEND" (cdadr (entget att)))) (setq attLst (cons (cons (cdr (assoc 2 (entget att))) (cdr (assoc 1 (entget att)))) attLst) att (entnext att))) Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted April 13, 2009 Author Share Posted April 13, 2009 Thanks for that, i can see you point i think, i extract the thing i want with (setq test (CDR (assoc "DWGNUM" ATTLST))) and it show me "x" for instance, how do i replace that? I was thinking "subst" what if their is another "x" their? Thank you for your suggestions, greatly appricatied Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 13, 2009 Share Posted April 13, 2009 I would test for its existence and replace like this: (if (setq att (assoc <tag> attLst)) (entmod (subst (cons 1 (cdr att)) att attLst))) Quote Link to comment Share on other sites More sharing options...
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.