Jump to content

Import multiple dwgs into drawing as individual blocks


Recommended Posts

Posted

Hi all,

 

My work have recently "upgraded" to Autocad LT 23 from an older full Autocad & as a result, I can no longer run my time saving Lisp routines.

 

We use a third party program which exports several dwg files per job. I had been using lisp to insert each dwg file as a block in my drawing, all spaced out along a row (eg block chart or insertblks).

 

Is there a way to do this without lisp? Everything i've found would mean importing one at a time.

 

Thanks

  • Like 1
Posted

Changing to say Bricscad would have been a better move.

 

Anyway you could maybe do something in excel its very easy to copy a column of commands to the command line.

 

image.png.7802b17bb5b74af7edeae07898c5889a.png

  • Like 1
Posted

thanks both for your replies.

 

I agree about Bricscad having used it in the past, but I am not in charge!

 

The spreadsheet idea is a good one - but the insert command just brings up the blocks paellete. I'm not sure how I reference the dwg file & it's path?

 

I've tried the following with no luck:

insert "C:\\USERS\\USER\\DESKTOP\\DRAWING.DWG" "0,0" 1 1 0

insert "C:\\USERS\\USER\\DESKTOP\\DRAWING.DWG" pt "" "" ""

-insert;C:\\USERS\\USER\\DESKTOP\\DRAWING.DWG;\;;

Posted

Watch out for spaces in file names or directories maybe -insert;"C:/USERS/USER/DESKTOP/DRAWING.DWG";\;;

  • 2 months later...
Posted

bump as i've still been unable to crack this. 

 

if I move all the files I want to insert into the same folder the main dwg is in, I can insert one at a time from the command line, but I cannot work out how to insert multiple files.

Posted (edited)

There are some old DOS tricks that let you make a list of dwg names throw that into excel and edit the -insert should work and as mentioned use dbl backslashes.

 

- insert "d:\\projects 2023\\bigtasks\\For Fred\\dgw1" "0,0" 1 1 0

 

Ok now for some DOS

lower left in windows do CMD the operating sytem will be exposed.

D :

Cd /projects 2023/bigtasks/For Fred

Dir *.dwg >dwglst.txt /b

 

You now have a list of all the dwgs in that directory open text file in excel and use the above -insert method.

Edited by BIGAL
Posted

Thanks, I am ok with generating a list of files. But I cannot work out how to use multiple files in the insert command. If I have to copy and paste the command for each file, it defeats the object as I can already drag them in one by one.

Posted

Ok you have Excel which has VBA as its macro language so there you are can do all sorts of shortcuts like choose dwgs, with explorer style choosing, enter X & Y spacing, then write the column. The -INSERT should work. There is a huge amount of excel macro examples out there should be able to find choose files.

 

Lt should support the copy of a column of rows to command line. Steven-G you out there ?

 

Posted

Thanks, but however I format the command, it only works with a single drawing.

 

Maybe i'm searching for the wrong thing, but I cannot find any examples that help

Posted

Does AutoCAD LT have the MULTIPLE command?

 

It might speed things up.

Posted

Yes it does have the multiple command, but unless I'm missing something I don't think it will save much time:

 

After I've generated a list of the files to import, I'd then use multiple which would prompt for each file.

 

I'd then need to copy the command for each file & paste separately.

 

Posted

How does dragging and dropping do for you?

 

Unfortunately, the use of LT and no LISP, just doing it faster is all you are going to achieve AFAIK.

Posted

drag and drop is ok when it's only a few files... sometimes I have a hundred or so it becomes painful!

Posted

XATTACH or XREF allows multiple selection and insert, but at 0,0 for all AFAIK. Works for me when I have drawings with the items at different distances from 0,0.

 

I would take the time to do it individually, the company cheaped-out and went to LT, nothing you can do really.

 

Maybe, do a monthly of full AutoCAD when you need to use LISP.

Posted

Unfortunately, the files are all at 0,0.

 

Yeah, it looks like they cheaped out & well wonder why productivity is lower!

Posted

I don’t know if your missing something I thought LT would support copy and paste of multiple lines, your column in excel must be just that 1cell is 1 line of insert command.

 

-insert mydwg1 “0,0” 1 1 0

-insert mydwg2 “100,100” 1 1 0

  • 1 month later...
Posted

It appears AutoCAD LT 2024 can use LISP. Hopefully you can upgrade now.

  • Like 1

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...