@Anonymous wrote:
Or how to insert 331 blocks ( i know blocks name) at 0,0 point with lisp or command?
You mean you wanted the blocks to inserted and not just part of a drawing block collection?
(defun c:InsertThem ( / aDoc f dwgFiles StrDiaFnme fnSTR StrDIA dd F2process insertedfile)
(setq aDoc (vla-get-activedocument (vlax-get-acad-object)))
(and
(setq f (acet-ui-pickdir "Select Project Folder" (getvar 'dwgprefix)))
(setq dwgFiles (vl-directory-files f "*.dwg" 1))
(progn
(setq StrDiaFnme (vl-filename-mktemp "tmp.DCL"))
(setq fnSTR (open StrDiaFnme "w"))
(write-line
"dcl_settings : default_dcl_settings { audit_level = 3; }
ListOfTags : dialog
{ label = \"Select Tag(s)\";
: list_box { key = \"TagList\"; multiple_select = true;
width = 8.0; height = 30.0; } spacer ;
ok_cancel; }" fnSTR)
(close fnSTR)
(setq StrDIA (load_dialog StrDiaFnme))
(if (not (new_dialog "ListOfTags" StrDIA))
(exit)
)
(start_list "TagList")
(mapcar 'add_list dwgFiles)
(end_list)
(action_tile "TagList" "(setq dd (get_tile \"TagList\"))")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(start_dialog)
(unload_dialog StrDIA)
(vl-file-delete StrDiaFnme)
dd
)
(setq F2process (mapcar '(lambda (k) (nth k dwgFiles))
(read (strcat "(" dd ")"))))
(foreach itm F2process
(vlax-invoke (vlax-get (vla-get-ActiveLayout aDoc)
'Block)
'InsertBlock
'(0.0 0.0 0.0)
(setq insertedfile (strcat f "\\" itm))
1 1 1 0)
(print insertedfile)
)
)
(princ)
)
This way, the user gets to select the files to be inserted.
HTH