Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been using this LISP in the office for putting in the typical details. When it works you click on the category you want and the List Box lists all the details in the appropriate file locations. After the office switched to Autocad LT, now the listbox will randomly be out of order. In one attempt the foundation details will be out of order, and in another attempt the concrete details will be out of order. It seemed to start doing this out of the blue, and my LISP knowledge is woefully beginner. Any ideas on why the list is randomly out of order?
LISP below V
;; List Box - Lee Mac
;; Displays a DCL list box allowing the user to make a selection from the supplied data.
;; msg - [str] Dialog label
;; lst - [lst] List of strings to display
;; bit - [int] 1=allow multiple; 2=return indexes
;; Returns: [lst] List of selected items/indexes, else nil
(defun LM:listbox ( msg lst bit / dch des tmp rtn )
(cond
( (not
(and
(setq tmp (vl-filename-mktemp nil nil ".dcl"))
(setq des (open tmp "w"))
(write-line
(strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select="
(if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}"
)
des
)
(not (close des))
(< 0 (setq dch (load_dialog tmp)))
(new_dialog "listbox" dch)
)
)
(prompt "\nError Loading List Box Dialog.")
)
( t
(start_list "list")
(foreach itm lst (add_list itm))
(end_list)
(setq rtn (set_tile "list" "0"))
(action_tile "list" "(setq rtn $value)")
(setq rtn
(if (= 1 (start_dialog))
(if (= 2 (logand 2 bit))
(read (strcat "(" rtn ")"))
(mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")")))
)
)
)
)
)
(if (< 0 dch)
(unload_dialog dch)
)
(if (and tmp (setq tmp (findfile tmp)))
(vl-file-delete tmp)
)
rtn
)
(defun C:TD ( / k blocks) ;TYPICAL DETAILS
(initget 1 "F G O E T L W P S N D M I A")
(setq k (getkword "\nWhich table are you using? [concrete Footing/Grade beams/cOncrete shearwall/concrEte beams/concreTe moment/bLock walls/Wood/Panelized roof/Steel beams/Non-comp deck/comp Deck/Metal studs/tIlt-up concrete/post tension slAb] :"))
(cond
((= k "F")
(Foreach itm
'("\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Concrete\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Misc\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Foundation\\"
)
(foreach dwg (LM:listbox "Select DWG" (vl-directory-files itm "*.dwg" 1) 1)
(command "_insert" (strcat itm dwg) pause "1" "1" "0")
)
)
)
);cond
)
(princ)
;|PUT IN A KEYWORD STATEMENT AND MAKE DIFFERENTS LISTS THAT GET CALLED FOR EACH CATEROY IE: CONCRETE FOOTING, GRADE BEAMS/PILES,
The filepath you used works now. Does it work on other peoples computers, or is that just a yours thing? You may have to put in a generic
FINDFILE code to apply to all computers. FINGERS CROSSED.
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Block\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Cold Form Steel\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Concrete\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Foundation\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Misc\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Modular\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\PT Slab\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Steel\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Tilt Up\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Truss\\"
"\\\\wdmycloudex1040\\public\\cad\\autocad blocks\\details\\Wood\\"
|;
Solved! Go to Solution.