View Full Version : Xref detacher
peter.clayton
2009-03-11, 09:57 PM
Looking for Lisp to remove all Xref's from my files as a batch program. I need this to clean all my reference files before submission.
A little more information would be helpful. Have you tried the ETransmit command?
peter.clayton
2009-03-11, 10:03 PM
No, I have not. Understand that I do not want to move the files. I will give it whirl.
andrea.andreetti
2009-03-12, 04:14 AM
check here (http://forums.augi.com/showthread.php?p=952363#post952363)
rkmcswain
2009-03-12, 05:56 AM
Looking for Lisp to remove all Xref's from my files as a batch program. I need this to clean all my reference files before submission.
Do you want to remove the references or bind them?
irneb
2009-03-17, 07:27 AM
As the other guys have stated, what exactly do you want to do? Perform a bind, or remove the lines of the xref from the drawing?
If it's a bind, then I'd also suggest eTransmit, you can do it programatically - but why go through all that trouble? And why would you want to do it to the original? You probably use xrefs because of some reason, as soon as you bind them - you'll loose that benefit (whatever it was). With eTransmit it makes a new copy with the xrefs bound and leaves the original untouched. You can even run this through ScriptPro on more than one DWG at once. So you can set it for all your files and leave the PC to finish over night.
If you want to litterally erase the xrefs, you'll need to step through the block's table with tblnext. Then check each block's 70 DXF code for if it's bitcode has 4 in it (check if block is xref). Then after getting all xref blocks, step through their definition's entities (the -2 DXF code points to the 1st entity in the block) searching for any reference to one of the other xrefs - if found remove it from the list as it's a nested xref. Then ensure that you delete all references of those xrefs in the remaining list. Then using the command line xref manager through (command ".-XREF" "_Detatch" bname) for each of those blocks, setting bname to the name contained in the 2 DXF code of each blocks definition. Then you may also need to loop this entire thing until no more xrefs are found, because an xref may be nested as well as attached directly. If you want this to happen in batch, you'll also need to run it through ScriptPro.
mweaver
2009-03-19, 05:45 AM
See post #4 here: http://forums.augi.com/showthread.php?t=97855
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.