Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

Brin,

 

Could you not make a LISP to insert your xRef, and then call the LISP from either a Script or Macro?

 

Lee

Posted

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

Posted
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

Posted

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

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

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