Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/04/2022 in all areas

  1. Another - (setq l1 '(("301" x y) ("304" x y) ("327" x y) ("331" x y) ("347" x y) ("352" x y) ("359" x y) ("361" x y)) l2 '("304" "352" "361") ) (vl-remove-if-not '(lambda ( x ) (member (car x) l2)) l1)
    1 point
  2. (foreach str '("304" "352" "361") (if (setq ass (assoc str '(("301" x y) ("304" x y) ("327" x y) ("331" x y) ("347" x y) ("352" x y) ("359" x y) ("361" x y)))) (setq grp (cons ass grp)) ) )
    1 point
  3. lisp49af :dialog {label="tabs"; :list_box {key="lb1";label="Select Bolt Type:"; allow_accept=true; tabs="8 16 24"; list="M20\t40LG\tGr. 8,8;\nM16\t30LG\tGr. 4,6;\nM30\t60LG\tGr. 8,8;\nM12\t35LG\tGr. 4,6;\nM8\t45LG\tGr. 8,8"; height=6;fixed_height=true;} ok_cancel; } it seems its important for this code to work everything on line 4 is on the same line alternatively you can pass the list to the dialog thru the lisp program because now the list will always be the same but what if you don't know how long your list is gonna be? look at : https://autolisp-exchange.com/Tutorials/MyDialogs.htm Somewhere in the middle of the page is an example called 'My Multi Lists' //--------------------------------------------------------------------------------------------------------- // MyMultiLists //--------------------------------------------------------------------------------------------------------- MyMultiLists : dialog { key = "Title"; label = ""; : boxed_column { label = "Select an Item"; : list_box { key = "List1";//Value1$ from lsp file height = 6.27; fixed_height = true; width = 32.92; fixed_width = true; } spacer; } : boxed_column { label = "Multi Select Items"; : list_box { multiple_select = true; key = "List2";//Value2$ from lsp file height = 6.27; fixed_height = true; width = 32.92; fixed_width = true; } spacer; } spacer; ok_only; }//MyMultiLists ;---------------------------------------------------------------------------------------------------------- ; c:MyMultiLists - Dialog for list_boxes with single and multi select examples ; Syntax: MyMultiLists ;---------------------------------------------------------------------------------------------------------- (defun c:MyMultiLists (/ Dcl_Id% List1@ List2@ Return# Value1$ Value2$) (princ "\nMyMultiLists")(princ) ; Set Default Variables (if (not *MyMultiLists@);Unique global variable name to store dialog info (setq *MyMultiLists@ (list nil "" "")) );if (setq Value1$ (nth 1 *MyMultiLists@) Value2$ (nth 2 *MyMultiLists@) List1@ (list "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday") List2@ (list "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December") );setq ; Load Dialog (setq Dcl_Id% (load_dialog "MyDialogs.dcl")) (new_dialog "MyMultiLists" Dcl_Id%) ; Set Dialog Initial Settings (set_tile "Title" " My Multi Lists") (set_tile_list "List1" List1@ Value1$);*Included (set_tile_list "List2" List2@ Value2$);*Included ; Dialog Actions (action_tile "List1" "(set_list_value \"List1@\" \"Value1$\")");*Included (action_tile "List2" "(set_multilist_value \"List2@\" \"Value2$\")");*Included (setq Return# (start_dialog)) ; Unload Dialog (unload_dialog Dcl_Id%) (setq *MyMultiLists@ (list nil Value1$ Value2$)) (princ) );defun c:MyMultiLists here you have ': list_box { key = "List1"; //Value1$ from lsp file' , which means this listbox will be filled by the program later on The lisp program does so by first creating a list called 'List1@' (setq List1@ (list "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday") and later it fills the listbox with : (set_tile_list "List1" List1@ Value1$) where Value1$ was set to "" earlier. Just study and play with the examples on the autocad-exchange link , they can do a far better job than me explaining
    1 point
  4. If your using layouts then can draw grids on Viewports. Yes code by me.
    1 point
  5. Maybe a hatch then change the scale to meet your spacing.
    1 point
  6. BigAl and Mhupp, that is my preference, to do all the stuff in LISP and then make an output where you want, thinking it is a lot simpler to keep everything within the same program I'd consider splitting the text (like BigAl suggests) and then a table in AutoCAD (Like Mhupp suggests). Keeping it all in CAD is my preference though I can understand sometimes you need to export to a spreadsheet. The OP is happy for now but it is possible and not too tricky to make this more helpful. Need a little more information from the OP for that I think, like a sample drawing and if they only ever search for one pipe size or if they repeat this exercise for many pipe sizes. Not sure how much the OP knows what LISP can do, maybe that is limiting what is asked for?
    1 point
  7. 1 point
  8. Yes works in Acad not Bricscad. I will ask Bricscad for maybe why not, they do reply have asked before. Mhupp your code the "." problem Command: C100.5 Unknown command "5". Press F1 for help.
    1 point
×
×
  • Create New...