The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hurricane for AutoCAD
 General Discussion
 Script for unloading/Detaching "unloaded" xrefs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

thillhouse
Starting Member



4 Posts

Posted - May 09 2006 :  2:34:47 PM  Show Profile  Visit thillhouse's Homepage  Reply with Quote
We are in the process of binding over 1000 sheet files with mutiple xrefs. Some of the sheets have unloaded xrefs and therefore do not bind. Is there a script out there that will detach unloaded xrefs? something like

if xref=unload then detach?

Admin
Administrator



652 Posts

Posted - May 09 2006 :  3:28:06 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hi,

The -XREF command has the following options...

Command: -xref
Enter an option [?/Bind/Detach/Path/Unload/Reload/Overlay/Attach]

You will need to know the xref's name in order to Detach it.

;SCRIPT
-XREF
DETACH
{xref name}
;END

This might not answer your question, but I will take a better look into it this evening...

But I hope this helps you out for the time being!?

Regards,
Bill



Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

Admin
Administrator



652 Posts

Posted - May 09 2006 :  6:39:14 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hmmm... took a look around... Found this lisp routine that might be a good starting point, you can use Hurricane to run it on all your files, courtesy of http://www.mossdesigns.com...

The description is as follows...
The routine basically searches through a drawing and locates all the xrefs. If the xref is loaded, it binds it (converts it to a block). If the xref is unloaded, the xref is detached. The drawing is then purged, zoom all, and then saved. As always, I have kept the code open and commented so lispers can use it as a jumping-off point for their own code.
Download Attachment: findbind.zip
1.16 KB

So you might want to edit it a bit, to suit your needs.

If you need help running it with Hurricane, let me know...

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

thillhouse
Starting Member



4 Posts

Posted - May 10 2006 :  09:36:25 AM  Show Profile  Visit thillhouse's Homepage  Reply with Quote
quote:
Originally posted by Admin

Hmmm... took a look around... Found this lisp routine that might be a good starting point, you can use Hurricane to run it on all your files, courtesy of http://www.mossdesigns.com...

The description is as follows...
The routine basically searches through a drawing and locates all the xrefs. If the xref is loaded, it binds it (converts it to a block). If the xref is unloaded, the xref is detached. The drawing is then purged, zoom all, and then saved. As always, I have kept the code open and commented so lispers can use it as a jumping-off point for their own code.
Download Attachment: findbind.zip
1.16 KB

So you might want to edit it a bit, to suit your needs.

If you need help running it with Hurricane, let me know...

Regards,
Bill



Bill Thanks for the information. I'm not much of a lisp routine writer so I can't realy follow what it is doing. It would be great if you could help transpose this into Hurricane.
From what I understand there is something called blockflag which indicates whether the xref is unloaded or not. How would I create an If/Then statement to handle this? Can I have hurrican run the script during the batch run?

It looks like this is what I need but I'm having trouble getting into Hurricane...
Thanks
Tim
Go to Top of Page

Admin
Administrator



652 Posts

Posted - May 10 2006 :  10:34:40 AM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hi Tim,

Unfortunately, scripting does not allow you to do "IF... then" type things. So to do what you require inside WILL require a lisp or VBA routine... (Hurricane can then run the lisp over and over again).

I have not heard of the blockflag variable you mention, maybe it exists in vlisp or vba (anyone else?) I'm sorry your issue can't be solved with scripting alone...

Hopefully someone will jump in here and help out...

Regards,
Bill


Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

n/a
deleted

112 Posts

Posted - May 10 2006 :  1:36:45 PM  Show Profile  Reply with Quote
Tim,
I don't use Xref's much, but I wonder if the blockflag you mention isn't a "flag" withing the DXF code of the block. I've attached a portion of the 2004 acad_dxf.chm file (located in the Help directory), which includes DXF 70, which is what you may be looking for? I don't know much more than that about Xrefs, but somewhere on this forum is reference to another (AutoDesk) customization forum where there are some phenomenal gurus who might be able and willing to help you, or a search there, may provide a ready-made solution, even.

Sorry I can't help much more than that, if that was any help at all.

Download Attachment: DXF Codes - Blocks.zip
5.85 KB

Steve Bubendorf
Go to Top of Page

Harald
Starting Member



Norway
2 Posts

Posted - September 05 2006 :  04:27:57 AM  Show Profile  Visit Harald's Homepage  Reply with Quote
You might have found a solution already, However I am facing the same problem - I wants to detach unloaded x-refs with Hurricane.

Problem is in my case solved. I found a lsp routine at Autodesk fora - posted by Jeff Mishler.

Download Attachment: rux.zip
761 Bytes


Just add this script to your hurricane script (Load) - and it will detach all your unloaded xrefs, and leave the loaded within the drawing. If you wants to bind the loaded x-refs - just add this below the load line in hurricane script:

rux
_-XREF
BIND
*

And you have no more x-refs connected to the drawing

-Harald
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.34 seconds. Snitz Forums 2000