Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

XREF Insert to multiple files

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
AJBuckers
7288 Views, 15 Replies

XREF Insert to multiple files

Hi everyone.

 

I have a single base file that I need to insert into about 50 separate drawings, is there a quick way of doing this in one hit? Don't really want to have to open each one in turn.

 

I have Autocad, Civil 3D and Map3d at my disposal if that helps, (although I'm mostly experienced with Autocad)

 

Thanks.

15 REPLIES 15
Message 2 of 16
TheCADnoob
in reply to: AJBuckers

This one is a bit of a journey and doesn't really use much traditional AutoCAD but it'll get the job done. 

 

We are going to look at using AutoCAD core console. Below is a screencast of the process. 

 

First you need to set up your files in a folder so as to only impact the files you want to add the xrefs to. It will apply it to every dwg in a folder so make sure you do due diligence to only affect the files you want. 

 

Next you are going to need to create two files. One will be a bat file which will do the Batch operation and the other will be a script file that will handle the xref application. I will try to attach the two files. (i tried attaching the files but the forum didnt like the .bat and .scr extension so i have changed them to text. Just remove the .txt extension and they should be good to go)

 

You will need to tailor the files to meet your conditions such as file localisations, script locations and the location of your core console application. you may have to tinker in the script file as well if you need the xref at a location different than 0,0. 

 

Once the foot work is done, its almost magical to see it run through saving you the hours of opening each file and applying the xref. Its a kind daunting task if you are not used to this sort of thing but its really not to bad once you get in it. I have also done a walk though on my webpage though its not specific to your needs and i tend to be crass there.  

 

 

CADnoob

EESignature

Message 3 of 16
AJBuckers
in reply to: TheCADnoob

CADnoob, outstanding reply, clear, concise and no BS. Thanks for the help!

 

Adam.

Message 4 of 16
TheCADnoob
in reply to: AJBuckers

Glad to help

CADnoob

EESignature

Message 5 of 16
Akbar
in reply to: TheCADnoob

Very nice!

Is this DOS commands?

Message 6 of 16
TheCADnoob
in reply to: Akbar

The bat files operate in the command window which is like DOS. The structure of the bat file is very similar to old DOS .bat syntax (if not exactly the same, but i dont know enough to say that definitively). 

 

AutoCAD coreconsole is a program that runs in the command window (unless suppressed). The actual AutoCAD operations are not DOS as the are executed by coreconsole. Coreconsol is AutoCAD without a GUI. You can just open up a windows command window and run AutoCAD coreconsole solely from the command window so it will look everything like running it all from DOS. 

CADnoob

EESignature

Message 7 of 16
Akbar
in reply to: TheCADnoob

Thanks! This is the first time I hear about this after 14 years of working with AutoCAD! I know a little of DIESEL and LISP! Where do I start if I want to learn more about Core Console?

Message 8 of 16
TheCADnoob
in reply to: Akbar

I haven't found much out there but i havent look much either. I did my walkthough but all my stuff was basicaly sourced from these Two sources; https://autocadtips1.com/2013/01/30/up-and-running-with-the-2013-core-console/

and https://through-the-interface.typepad.com/through_the_interface/2012/03/commands-that-work-in-the-au...

 

CADnoob

EESignature

Message 9 of 16
Akbar
in reply to: TheCADnoob

Great!

Thanks!

 

Message 10 of 16
Anonymous
in reply to: TheCADnoob

Hi, firstly thankyou for posting this.

 

I have tried to amend your files to suit the file paths for where my drawings and xefs are saved, and the location of the where the acaccoreconsole.EXE is saved and I am getting an error message.

 

can you advise where I have gone wrong please?

 

Cheers

Ryan.

 

 

Message 11 of 16
TheCADnoob
in reply to: Anonymous

Those kinds of errors can have multiple causes unfortunately. 

https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/Fatal-...

 

That said is your script in a trusted location?

 

 

 

 

CADnoob

EESignature

Message 12 of 16
SianSiam
in reply to: TheCADnoob

Hello Sir,

 

Could there be away to insert the Xref at layouts only?

 

Thanks in advanced.

Message 13 of 16
Akbar
in reply to: SianSiam

Of Course! I do it all the time by mistake!

Just use TILEMODE=0

Message 14 of 16
SianSiam
in reply to: Akbar

Thanks for the quick reply.

Is not the TILEMODE=0 required to open the dwg? Or Do I just need to add in the .bat or .scr?

I can insert the Xref in Layout, only if it was saved as the layout is active. 

I want to insert the Xref file without having to open the dwg whether the model or layout is active but insert in layout space.

Does it make sense? I am sorry if it is hard to understand. I am not really good at English. It is my second language. 

 

Thanks in advanced.

 

Message 15 of 16
kevino
in reply to: TheCADnoob

How about the opposite of xrefing multiple drawings into one drawing at different coordinates? So bring in 50 drawings, the first one at 0,0 then let's say they are 600' apart 5 wide, then drop down to 0,-600' then go another five wide and so on until all the drawings have been inserted.

Thanks in advance.
Message 16 of 16
TheCADnoob
in reply to: kevino

Sorry for the late reply. That would be doable but im not certain this would be the best approach for doin that. The time it would take to create the script might be better spent just performing the actions. If the insert locations are at a set interval you could probably use a list to do it which could be called form core console, but again not sure that would be the best way to handle that. It might be better to just do a lisp (or VBA) and not involve coreconsole

CADnoob

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost