Jump to content

Add multiple xref and bind together


Recommended Posts

Dear team ,


I used etransmit command >add file  than bind xref option, but not bind in current drawing.


Is any tools or lisp, VBA macro for add multiple xref and bind together in current file and save as a zip file.?


Note :, Xref not attached in current drawing. I need to attach multiple and bind together in current drawing.





Link to comment
Share on other sites

I don't have anything but the command "XA" - Xref Attach runs through the command line and can be used such as:


(command "XA" -FilePath- ......)


If you know the files to attach, create a list with the LISP and loop through that to XA them all


Next step, binding, -xref runs with the command line, and so with LISP


(command "-xref" "Bind" .....)


And you could probably combine these 2 lines together with the -xref command



that should attach many xrefs and bind them to the current drawing - needs you to produce a list of drawings to use and the insertion points as a start

Link to comment
Share on other sites

I can unzip from CAD uses Powershell a inbuilt command in windows, ok so could do a zip problem I see is if have dwg open the zip may work or worse zip up a not saved version. So you would need to save the dwg then zip it. Using a script it could be possible. 


Google powershell zip file.


This is unzip, filename is passed from lisp.


(startapp (strcat "powershell -command Expand-Archive -Path '" filename "' -DestinationPath 'C:/CAD-TOOLS' -FORCE"))

ok feel generous

(setq filename "d:\\acadtemp\\testbrics.bmp")
(startapp (strcat "powershell -command Compress-Archive -path '" filename "' -DestinationPath 'D:/Acadtemp/testvrics.zip'"))


Edited by BIGAL
Link to comment
Share on other sites

Sir, actually I need to attach xref from the directory by selecting, example I have 15 xref but required only 7.



Attached multiple xref



Zip file


4 in 1 process

Link to comment
Share on other sites

have you tried making up some LISP code for this by the way? and how far have you got?


Try making up a simple LISP to attach and bind a single xref, you can just write in the filepath of the file for now and get that working using the hints above

Purge is easy

(command "PURGE" "A" "*" "N")


and repeat that line 2 or 3 times just in case


BIgAl has given how to ZIP a file above, it should be al here for you to put together


Post that and ask how to select multiple files though this (http://www.lee-mac.com/getfilesdialog.html) will let you select multiple files



Make it work for 1 file, post your code, and then we can work on making it work for many files - a great way to learn trying it yourself

Link to comment
Share on other sites

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.

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