Author Topic: Make a block un-purgable?  (Read 11481 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Make a block un-purgable?
« on: February 21, 2013, 08:37:06 AM »
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.

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Make a block un-purgable?
« Reply #1 on: February 21, 2013, 08:50:29 AM »
Only if it is used in some way. Like on a frozen layer, on a layout, or as marker in an used dimstyle.

But if one really needs to strip the block, there is nothing to do about.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Drafter X

  • Swamp Rat
  • Posts: 578
Re: Make a block un-purgable?
« Reply #2 on: February 21, 2013, 08:54:58 AM »
make it invisible
CadJockey Militia Commander

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Make a block un-purgable?
« Reply #3 on: February 21, 2013, 12:16:09 PM »
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.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

fixo

  • Guest
Re: Make a block un-purgable?
« Reply #4 on: February 21, 2013, 12:28:12 PM »
perhaps to add xdata to this block definition, just an idea

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: Make a block un-purgable?
« Reply #5 on: February 21, 2013, 12:31:16 PM »
As far as I was aware, to make an object truly 'unpurgable', you need to use a hard reference, however, I don't believe such a reference can be created using AutoLISP / Visual LISP.

trogg

  • Bull Frog
  • Posts: 255
Re: Make a block un-purgable?
« Reply #6 on: February 21, 2013, 04:03:42 PM »
What about this?: http://www.theswamp.org/index.php?topic=10978.msg139130#msg139130
We used it in a "seed" file at work instead of using a template to make a text and dim style available. It worked quite well.
(we used the routine provided by madcadder)
~Greg

kruuger

  • Swamp Rat
  • Posts: 637
Re: Make a block un-purgable?
« Reply #7 on: February 21, 2013, 06:09:42 PM »
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

Referring to trogg link. try to delete layers from this drawing (small puzzle autocad)  ;)
k.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Make a block un-purgable?
« Reply #8 on: February 21, 2013, 06:24:39 PM »
 :-P

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

kruuger

  • Swamp Rat
  • Posts: 637
Re: Make a block un-purgable?
« Reply #9 on: February 21, 2013, 06:36:09 PM »
:P
i should rather say, try to purge. :|
what option/lisp to clean dwg ?
k.

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: Make a block un-purgable?
« Reply #10 on: February 21, 2013, 07:25:26 PM »
:P
i should rather say, try to purge. :|
what option/lisp to clean dwg ?
k.

This is what I use:
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)
)

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: Make a block un-purgable?
« Reply #11 on: February 21, 2013, 08:12:41 PM »
Try to delete layers from this drawing (small puzzle autocad)  ;)

Look what I found  :wink:
Code: [Select]
(mapcar 'print (entget (handent "9C28")))
Layers purgable after:
Code: [Select]
(dictremove (cdr (assoc 360 (entget (cdr (assoc 330 (entget (tblobjname "LAYER" "0"))))))) "JCAD_LAYERS")
Fun puzzle :-)
« Last Edit: February 21, 2013, 08:18:21 PM by Lee Mac »

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Make a block un-purgable?
« Reply #12 on: February 21, 2013, 08:25:08 PM »
Not sure how to do it in lisp but very easy in .Net or ObjectARX,


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).






kruuger

  • Swamp Rat
  • Posts: 637
Re: Make a block un-purgable?
« Reply #13 on: February 22, 2013, 01:53:57 AM »
Layers purgable after:
Code: [Select]
(dictremove (cdr (assoc 360 (entget (cdr (assoc 330 (entget (tblobjname "LAYER" "0"))))))) "JCAD_LAYERS")
yep  :)
kruuger


Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: Make a block un-purgable?
« Reply #14 on: February 22, 2013, 05:51:16 AM »
This is what I use:
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.