Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Detach Unloaded Xrefs Routine

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
3842 Views, 3 Replies

Detach Unloaded Xrefs Routine

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?
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

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?
>
>
>
>
>
Message 3 of 4
Anonymous
in reply to: Anonymous

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?
>
>
>
>
>
Message 4 of 4
Anonymous
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost