make it invisible
Apart from inserting a reference (on a frozen layer) somewhere, is there a way to make a 'normal' fixed block un-purgable? Note: I am using BricsCAD.if you have a company title block border in your drawing (for example at layout) just add your block to border with small scale x=y=z=0.00001
:Pi should rather say, try to purge. :|
:Pi should rather say, try to purge. :|
what option/lisp to clean dwg ?
k.
(defun c:wba ( / dwg fnm tmp )
(setq fnm
(strcat
(getvar 'dwgprefix)
(cadr (fnsplitl (getvar 'dwgname)))
"_wblock"
)
)
(if (findfile (setq dwg (strcat fnm ".dwg")))
(progn
(setq tmp 1)
(while (findfile (setq dwg (strcat fnm "(" (itoa (setq tmp (1+ tmp))) ").dwg"))))
)
)
(command "_.wblock" dwg "*")
(princ)
)
Try to delete layers from this drawing (small puzzle autocad) ;)
(mapcar 'print (entget (handent "9C28")))
(dictremove (cdr (assoc 360 (entget (cdr (assoc 330 (entget (tblobjname "LAYER" "0"))))))) "JCAD_LAYERS")
Layers purgable after:yep :)Code: [Select](dictremove (cdr (assoc 360 (entget (cdr (assoc 330 (entget (tblobjname "LAYER" "0"))))))) "JCAD_LAYERS")
This is what I use:Try to purge this.Code: [Select](defun c:wba ( / dwg fnm tmp )
(setq fnm
(strcat
(getvar 'dwgprefix)
(cadr (fnsplitl (getvar 'dwgname)))
"_wblock"
)
)
(if (findfile (setq dwg (strcat fnm ".dwg")))
(progn
(setq tmp 1)
(while (findfile (setq dwg (strcat fnm "(" (itoa (setq tmp (1+ tmp))) ").dwg"))))
)
)
(command "_.wblock" dwg "*")
(princ)
)
Try to purge this.
You can add a entry to the NamedObjectDictionary, or the ExtensionDictionary of ModelSpace, etc..(Something that will always be in a drawing and never removed like ModelSpace) with the ObjectId of the BlockTableRecord and with a HardPointerObjectId typecode(340).This can also be done through Lisp. Example (without error checking):
It is obvious only if dimension style name is STANDARD...Try to purge this.
The layer is referenced by the dimension arrowhead block so it obviously won't be purged :?
Don't know, maybe it should be like killing fleas with cannonballs (as we say in Spain), but... What about a persistent reactor that re-built the block after purging it... :|It's an interesting thought, but for my needs it is indeed a canonball. :-D
Regards.
I think the "xdata" idea would be to place a Database-Handle (code 1005) in the xdata of something like Layer 0 / Model Space to point to the handle (code 5) of the block definition. But still, your xdata might be purgeable through registered apps.I have done just that in the drawing attached to one of my previous posts. It may work in AutoCAD but it doesn't in BricsCAD.
If you look at block definitions as (source) containers for (geometrical) data there can be good reasons for making such definitions unpurgable in certain contexts (read: as long as their target entities are in the drawing). I believe AutoCAD's dynamic block implementation uses a form of purge prevention.Well, in such case I'd advise you use dictionaries attached to those target entities which include "hard pointers" to the block definition (as you've noted the xdata only provides soft pointers). This would be similar (if not exactly the same) as adesk has done for dynamic blocks.
That is exactly what I was thinking. Insert @ 0,0 scale to a minute scale on layer "defpoints" then make it invisible.make it invisible
Ugh, please NO. Along with making the block attribute only with the attributes hidden, or making it dynamic with a visibility state with all graphics turned off, blocks that cannot be found follow the "out of sight, out of mind" principle. They accumulate and before you know it, your drawings (and blocks) have thousands of inserts.