Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Wojtynek, Steve
Message 1 of 4 (1,027 Views)

Detach Unloaded Xrefs Routine

1027 Views, 3 Replies
12-01-2003 06:40 AM
It seems some people like to Unload the xrefs they used for five minutes
rather than detaching them when finished. Then the xref gets deleted down
the road... You know.

I could use a routine that will get rid of xrefs that are not needed when
the project is finished. I'm figuring that if the xref was Unloaded at the
time of the final plotting, then it wasn't necessary to produce the plotted
image (which is what our archiving process is all about).

Is this an easy one?
*Mishler, Jeff
Message 2 of 4 (1,027 Views)

Re: Detach Unloaded Xrefs Routine

12-01-2003 08:00 AM in reply to: *Wojtynek, Steve
Sure, try this....
Warning, it will also detach Xrefs that may just be unresolved, but that
shouldn't be a problem in your case since the final plot has been done....

Jeff

(defun remove-unloaded-xrefs ()
(vlax-for block (vla-get-blocks
(vla-get-activedocument
(vlax-get-acad-object)))
(if (and (= :vlax-true (vla-get-isxref block))
(= 0 (vla-get-count block))
)
(vla-detach block)
)
)
)
(defun c:rux ()
(remove-unloaded-xrefs)
(princ)
)


"Steve Wojtynek" wrote in message
news:9A16C317881C025CFFB97DD1636DA96F@in.WebX.maYIadrTaRb...
> It seems some people like to Unload the xrefs they used for five minutes
> rather than detaching them when finished. Then the xref gets deleted down
> the road... You know.
>
> I could use a routine that will get rid of xrefs that are not needed when
> the project is finished. I'm figuring that if the xref was Unloaded at
the
> time of the final plotting, then it wasn't necessary to produce the
plotted
> image (which is what our archiving process is all about).
>
> Is this an easy one?
>
>
>
>
>
*Poel, Jan van de
Message 3 of 4 (1,027 Views)

Re: Detach Unloaded Xrefs Routine

12-01-2003 04:15 PM in reply to: *Wojtynek, Steve
Educate your users!
Let them keep their drawings clean, no unused X-refs, get the drawings
purged !!
Eventually use wblock.

From managing point its important that the users do that, think of storage
and backup,
loading time, editing time etc

Example:
received an architectural drawing, size 5.6Mb.
ran a simple purge, size 2.5Mb.
used wblock, size 677Kb. !!
No details were missing in the drawing, loads faster, pans faster etc.

Our drawings rarely grow over 1Mb (construction), as soon as the drawing is
bigger, the user is addressed to clean up.

Jan

"Steve Wojtynek" schreef in bericht
news:9A16C317881C025CFFB97DD1636DA96F@in.WebX.maYIadrTaRb...
> It seems some people like to Unload the xrefs they used for five minutes
> rather than detaching them when finished. Then the xref gets deleted down
> the road... You know.
>
> I could use a routine that will get rid of xrefs that are not needed when
> the project is finished. I'm figuring that if the xref was Unloaded at
the
> time of the final plotting, then it wasn't necessary to produce the
plotted
> image (which is what our archiving process is all about).
>
> Is this an easy one?
>
>
>
>
>
*Wojtynek, Steve
Message 4 of 4 (1,027 Views)

Re: Detach Unloaded Xrefs Routine

12-02-2003 05:29 AM in reply to: *Wojtynek, Steve
Jeff: Haven't tried it yet, but thanks again. (You helped with another one
a while back.)

Jan: Education only occurs when someone wants to learn something... I
created a magic toolbar button called CLN UP that runs a script to Purge,
Audit, change Xref paths to "no path", and then Save. I figure people might
practice a little "Cad Hygiene" if they can hit one button to do it. I'll
be adding Jeff's routine to a similar script for final archiving purposes.
I don't want to strip out unloaded xrefs when people might still need them.
Thanks for the input.


"Steve Wojtynek" wrote in message
news:9A16C317881C025CFFB97DD1636DA96F@in.WebX.maYIadrTaRb...
> It seems some people like to Unload the xrefs they used for five minutes
> rather than detaching them when finished. Then the xref gets deleted down
> the road... You know.
>
> I could use a routine that will get rid of xrefs that are not needed when
> the project is finished. I'm figuring that if the xref was Unloaded at
the
> time of the final plotting, then it wasn't necessary to produce the
plotted
> image (which is what our archiving process is all about).
>
> Is this an easy one?
>
>
>
>
>
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.