Jump to content

Multiple block inserts


grouch19

Recommended Posts

Does anyone know if it is possible to insert multiple DWG's into one drawing? I have about 125 files i need to insert together. I used to write a script for it but it is getting a little tedious to have to type out and edit the entire script when there are so many files to insert

Cheers

Link to comment
Share on other sites

i meant to say in the first line "can you insert multiple DWG's automatically. Without a script is the general thing im looking for!

Link to comment
Share on other sites

Try this, It may work.

 

First x-ref all the drawings. in xref>attach dialoguebox, you can select multiple sheets holding 'ctrl'. after attching them as an xref, you can select all in xref manager & use bind/insert option. (make sure to have insbase approprate for all the files so that they come in proper location in your main file)

Link to comment
Share on other sites

assuming that you want to insert the same 125 blocks into a set of drawings in the same place I would make a single file with all your blocks in place and then insert that file already exploded - still a script but a lot less tedious.

Link to comment
Share on other sites

would this work, or are you wanting all the blocks placed at the same insertion point?

(defun c:insertblks (/ d doc lst pt pt1 dir)
 (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
 (if
   (and (setq
      dir (vl-filename-directory
        (getfiled "Select a DWG" (getvar 'dwgprefix) "dwg" 
          )
    )
    (setq lst (vl-directory-files dir "*.dwg"))
    (setq pt1 (getpoint "\nSelect point for first block: "))
    (setq d
       (distance (getpoint pt1 "\nSelect distance to space blocks: ")
             pt1
       )
    )
   )
    (foreach b    lst
      (vla-insertblock
    (if (= (getvar 'cvport) 1)
      (vla-get-paperspace doc)
      (vla-get-modelspace doc)
    )
    (vlax-3d-point (setq pt1 (polar pt1 0.0 d)))
    (strcat dir "\\" b)
    1
    1
    1
    0.0
      )
    )
 )
 (princ)
)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...