Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

XREF Insert to multiple files

AJBuckers
Enthusiast

XREF Insert to multiple files

AJBuckers
Enthusiast
Enthusiast

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.

0 Me gusta
Responder
Soluciones aceptadas (1)
9.708 Vistas
15 Respuestas
Respuestas (15)

TheCADnoob
Mentor
Mentor
Solución aceptada

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

AJBuckers
Enthusiast
Enthusiast

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

 

Adam.

TheCADnoob
Mentor
Mentor

Glad to help

CADnoob

EESignature

0 Me gusta

Anonymous
No aplicable

Very nice!

Is this DOS commands?

0 Me gusta

TheCADnoob
Mentor
Mentor

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

0 Me gusta

Anonymous
No aplicable

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?

0 Me gusta

TheCADnoob
Mentor
Mentor

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

Anonymous
No aplicable

Great!

Thanks!

 

0 Me gusta

Anonymous
No aplicable

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.

 

 

0 Me gusta

TheCADnoob
Mentor
Mentor

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

0 Me gusta

SianSiam
Enthusiast
Enthusiast

Hello Sir,

 

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

 

Thanks in advanced.

0 Me gusta

Anonymous
No aplicable

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

Just use TILEMODE=0

0 Me gusta

SianSiam
Enthusiast
Enthusiast

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.

 

0 Me gusta

kevino
Explorer
Explorer
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.
0 Me gusta

TheCADnoob
Mentor
Mentor

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

0 Me gusta