Brin Posted January 21, 2010 Posted January 21, 2010 Hi all, Im trying to do a basic script file to insert about 10 xrefs from diffrent folders. The same refrences are neded in lots of drawings. then when finished the editing we need to remove all xrefs. I was hoping to make an insert, and a remove button to save having to navigate to each directory and insert manually. I was trying to do a something like -xref a "File path\File name" 0,0 1 0 When I run this I get the message Enter name of file to attach: "HW_ML_001": Warning: If you are trying to attach the file: "HW_ML_001": as an Xref, it must be attached using the = syntax. *Invalid* Thanks Brin Quote
David Bethel Posted January 21, 2010 Posted January 21, 2010 Could be a couple things: This is missing a Y scale input -xref a "File path\File name" 0,0 1 0 Or Enter name of file to attach: "HW_ML_001": The block may already be referenced as a block, not an XREF Good luck. -David Quote
Brin Posted January 25, 2010 Author Posted January 25, 2010 Thanks David, I will add the Y scale and see if that changes anything, I thing the problem is with my syntax though, I dont understand what it is asking for when saying "=" I have spaces in the path name and forward slashes, I have tried underscores and backslashes, but still no joy. I have put it in like this but it doesnt seem to be correct... = Cheers Quote
Lee Mac Posted January 25, 2010 Posted January 25, 2010 Brin, Could you not make a LISP to insert your xRef, and then call the LISP from either a Script or Macro? Lee Quote
Brin Posted January 25, 2010 Author Posted January 25, 2010 Hi Lee, Yes, Lisps are a bit beyond me, I did try and learn how, but basic scripts are a far as I can manage! I thought it would be pretty easy to do what I am after with a script, and then just change, or add, file paths when needed. A chap in work is looking into the lsp route. As he has a good idea about them. I will post whatever we get to work. Brin Quote
JeepMaster Posted January 25, 2010 Posted January 25, 2010 Thanks David, I will add the Y scale and see if that changes anything, I thing the problem is with my syntax though, I dont understand what it is asking for when saying "=" I have spaces in the path name and forward slashes, I have tried underscores and backslashes, but still no joy. I have put it in like this but it doesnt seem to be correct... = Cheers Here's a script that I used to set layer and insert xref into drawings. Your slashes seems to be backwards. Autocad is different that way. -LAYER N XREF-SEALS S XREF-SEALS -XREF O "L:\buildings\STAMP.dwg" 0,0 1 1 0 _imageframe 2 QSAVE Quote
Brin Posted January 26, 2010 Author Posted January 26, 2010 Thanks JeepMaster. I knew it was something simple I used this part and it works fine. -XREF O "L:\buildings\STAMP.dwg" 0,0 1 1 0 It is also possible to repeat this to say -XREF O "L:\buildings\STAMP.dwg" 0,0 1 1 0 -XREF O "L:\buildings\STAMP2.dwg" 0,0 1 1 0 And this inserts multiple drawings. Just what I needed. Cheers Quote
dbroada Posted January 26, 2010 Posted January 26, 2010 Your slashes seems to be backwards. Autocad is different that way.AutoCAD used to use a backslash as a delimiting character. If you needed a file name you could either use a single forward slash or a pair of backslashes. If you can use single backslashes now AutoCAD must have changed. Quote
Recommended Posts
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.