Now that was the best laugh I had all day....
//---------------------------------------------------------------------------------------------------------
// Architectural Layers Conversion Program - List Box Capture
//---------------------------------------------------------------------------------------------------------
(defun @layerlist (str / lst)
(foreach i (read (strcat "(" str ")"))
(setq lst (cons (nth i txtlist) lst))
)
(reverse lst)
)
//---------------------------------------------------------------------------------------------------------
// Architectural Layers Conversion Program - Create Layers
//---------------------------------------------------------------------------------------------------------
(defun c_layers (/)
(command "-layer" "n" "A-COL, A-DOOR, A-FLOR-STRS, A-FURN, A-MOD-PNL, A-MOD-WKSF, A-WALL, A-WIND" "")
)
//---------------------------------------------------------------------------------------------------------
// Architectural Layers Conversion Program - Delete Layers
//---------------------------------------------------------------------------------------------------------
(defun dal ()
(command "-laydel" "n" "layers" "" "y")
)
//---------------------------------------------------------------------------------------------------------
// Architectural Layers Conversion Program - Load text file from creation
//---------------------------------------------------------------------------------------------------------
(defun c:archi ( / result dcl_id)
(setq txtlist (list))
(setq openfile (open "c:/lsp/david.txt" "r")); reading the list
(while (setq line (read-line openfile))
(setq txtlist (append txtlist (list line)))
)
(close openfile)
//---------------------------------------------------------------------------------------------------------
// Architectural Layers Conversion Program - Load DCL Box for list
//---------------------------------------------------------------------------------------------------------
(setq dcl_id (load_dialog "DCR_PROGRAM.dcl")); loading the DCL
(if (not (new_dialog "dcl_test" dcl_id))
(progn
(alert "The DCR PROGRAM.dcl file could not be loaded!")
(exit)
)
)
(progn
(start_list "layerlist")
(mapcar 'add_list txtlist); Adding the text to the layerlist box
(end_list); end list
//---------------------------------------------------------------------------------------------------------
// Architectural Layers Conversion Program - Tile actions for conversion of selected text from list
//---------------------------------------------------------------------------------------------------------
(action_tile "layerlist" "(setq layers (@layerlist $value))")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq action (start_dialog))
(cond
((/= action 1)) ;; do nothing
((= choice "delete")
(foreach layer layers (command "-laydel" "n" layer "" "y"))
)
)
;(action_tile "a-convert" "(done_dialog)(setq result T))")
;(action_tile "a-col" "(done_dialog)(setq result nil))")
;(action_tile "a-door" "(done_dialog)(setq result nil))")
;(action_tile "a-flor-strs" "(done_dialog)(setq result nil))")
;(action_tile "a-furn" "(done_dialog)(setq result nil))")
;(action_tile "a-mod-wksf" "(done_dialog)(setq result nil))")
;(action_tile "a-mod-wall" "(done_dialog)(setq result nil))")
;(action_tile "a-mod-wind" "(done_dialog)(setq result nil))")
;(unload_dialog dcl_id)
;(if result
;(der)
😉
😉
(princ)
😉