Taking Items off a list/ edit lists

Taking Items off a list/ edit lists

Anonymous
Not applicable
947 Views
5 Replies
Message 1 of 6

Taking Items off a list/ edit lists

Anonymous
Not applicable

I hate having to go throughout the file directory when placing blocks onto a typical detail sheet. I want to have two folders. 

1) family of typical details (concrete footing, wood, steel beams)

2)Sub folder of the individual details (conc1-5, conc2-6)

 

My knowledge is extremely limited. This is what I have so far. 

 

Thanks in advance.

0 Likes
Accepted solutions (1)
948 Views
5 Replies
Replies (5)
Message 2 of 6

pbejse
Mentor
Mentor

@Anonymous wrote:

1) family of typical details (concrete footing, wood, steel beams)

2)Sub folder of the individual details (conc1-5, conc2-6)


 

Your best bet is Tool Palettes.  <--- read about it 

About Creating Tool Palettes    <--- read about it 

 

 

0 Likes
Message 3 of 6

Anonymous
Not applicable

I'm looking to cut out some middle tasks and insert the blocks one right after the other. so Instead of having to go into the tool pallete, click what block I want, and the insert I'd like to make a list of blocks to insert and insert them in one go.

Also sometimes the blocks change in our library so I'm more keen on picking from the library that having a set location.

0 Likes
Message 4 of 6

pbejse
Mentor
Mentor
Accepted solution

 

The routine will insert ALL the drawing files inside the two folders one by one, all you need to do now is add and/or remove files from the defiend folder.

 

 

(defun c:tastybread ()
  (Foreach itm '("N:\\CAD\\AutoCad Blocks\\Details\\Concrete\\"
		 "N:\\CAD\\AutoCad Blocks\\Details\\Misc\\"
		)
    (foreach dwg (vl-directory-files itm "*.dwg" 1)
      (command "_insert" (strcat itm dwg) pause "1" "1" "0")
    )
  )
)

 

HTH

 

Now if there are drawing files on the same folder but you need to all of them, use a listbox , where you can select on the files you to insert

 

;; 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:tastybread ( /  blocks)
  (Foreach itm '("N:\\CAD\\AutoCad Blocks\\Details\\Concrete\\"
		 "N:\\CAD\\AutoCad Blocks\\Details\\Misc\\"
		)
    (foreach dwg (LM:listbox "Select drawing Files" (vl-directory-files itm "*.dwg" 1) 1)
      (command "_insert" (strcat itm dwg) pause "1" "1" "0")
    )
  )
)
Message 5 of 6

Anonymous
Not applicable

Geez you came up with that quick!

0 Likes
Message 6 of 6

Anonymous
Not applicable

Exactly what I was looking for! Thank you so much.

0 Likes