Author Topic: Block problem.  (Read 5162 times)

0 Members and 1 Guest are viewing this topic.

hudster

  • Gator
  • Posts: 2848
Block problem.
« on: September 23, 2004, 06:08:25 AM »
I have a drawing I received from an architect made up entirely of blocks, but even though I've used the Fixblock lisp to move all the entities to layer 0 the original layers still are being referenced by some of the blocks in the drawing.

I've tried to refedit the blocks to change the properties, but the blocks are non-uniformedly scaled so I can't edit them.

I don't want to explode any of the blocks as the drawing then becomes massive and as it's to be used as an Xref on 100's of drawings, I want to keep the size as low as possible.

Anyone have any ideas on how I can get rid of these layers without exploding the blocks?
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

CADaver

  • Guest
Re: Block problem.
« Reply #1 on: September 23, 2004, 07:25:28 AM »
Quote from: Hudster
I have a drawing I received from an architect made up entirely of blocks, but even though I've used the Fixblock lisp to move all the entities to layer 0 the original layers still are being referenced by some of the blocks in the drawing.
Could it be that those layers are frozen in some viewport?  If so they won't purge.

hudster

  • Gator
  • Posts: 2848
Block problem.
« Reply #2 on: September 23, 2004, 07:37:36 AM »
I tried that, I've also cut and paste the drawing into a new drawing and deleted all the layout tabs as well and their still there.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

CADaver

  • Guest
Block problem.
« Reply #3 on: September 23, 2004, 08:05:12 AM »
Have you tried SSX to find the offending layers?

or

Copy the drawing to a different name, explode all the blocks and use filter (or SSX) to find the offending elements.

David Bethel

  • Swamp Rat
  • Posts: 656
Block problem.
« Reply #4 on: September 23, 2004, 08:09:04 AM »
If the original block contained an empty named layer, then it will not show up in block table definition.  The layer is therefore referenced and not purgeable.  -David
R12 Dos - A2K

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Block problem.
« Reply #5 on: September 23, 2004, 08:18:30 AM »
There are a couple of issues ...
1) Are there any old style polylines, if so the seqend entity may be referencing the layer you want to delete.
2) Are there blocks with attributes, if so, the seqend entity may be referencing the layer you want to delete.

If there are not any of these issues, and you suspect a non-uniform scaled block may be the culprit, simply insert that block (at a uniform scale) and refedit that block. When you are done, simply delete the block.

You might try the expresstool "laymrg"
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Block problem.
« Reply #6 on: September 23, 2004, 08:49:32 AM »
Could you upload an offending block for us to test? 8)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CADaver

  • Guest
Block problem.
« Reply #7 on: September 23, 2004, 08:57:52 AM »
Quote from: David D Bethel
If the original block contained an empty named layer, then it will not show up in block table definition.  The layer is therefore referenced and not purgeable.  -David


Quote from: Keith
There are a couple of issues ...
1) Are there any old style polylines, if so the seqend entity may be referencing the layer you want to delete.
2) Are there blocks with attributes, if so, the seqend entity may be referencing the layer you want to delete.

If there are not any of these issues, and you suspect a non-uniform scaled block may be the culprit, simply insert that block (at a uniform scale) and refedit that block. When you are done, simply delete the block.

You might try the expresstool "laymrg"


See, I thought FIXBLOCK.LSP fixed all that within the block definitions.  Granted I've never used FIXLOCK, but that was how it was explained to me.

hudster

  • Gator
  • Posts: 2848
Block problem.
« Reply #8 on: September 23, 2004, 09:10:01 AM »
I tried exploding it, and when I did a block appeared called *b17.
This block isn't on the list when you look at the insert block list, I also inserted each block again and refedited each one, and managed to get rid of a few extra layers, but most are still there.  But none of them showed the *b17 block as being a part of them.

I can't upload a copy as the client is quite sensitive about his drawings being issed.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

hudster

  • Gator
  • Posts: 2848
Block problem.
« Reply #9 on: September 23, 2004, 09:52:44 AM »
here is a block that has a layer attached.

I've inserted it, refedited it, exploded all contents, changed them to layer 0, and changed to colour to by block.

When I explode it I can purge the block and the layer it's on.  but when I purge the block the layer called Frame-5 can be purged, this can't be purged till i've exploded the block.

when I try layer merge it gets rid of my layer, but the Frame-5 layer still exists.  When I try to merge that I get a message stating Frame-5 couldn't be purged as an object in the drawing is referencing it.

Any Ideas

I've placed a copy of the file in my folder on the lilly pond, but I'm having problems linking to it at the moment.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

M-dub

  • Guest
Block problem.
« Reply #10 on: September 23, 2004, 09:54:37 AM »
We've had this (or similar at least) problem before and it was due to what you've just mentioned.  Nested blocks...nested three or four fold!  Some people shouldn't be allowed to use CAD!

CADaver

  • Guest
Block problem.
« Reply #11 on: September 23, 2004, 10:35:38 AM »
Quote from: Hudster
here is a block that has a layer attached.

I've inserted it, refedited it, exploded all contents, changed them to layer 0, and changed to colour to by block.

When I explode it I can purge the block and the layer it's on.  but when I purge the block the layer called Frame-5 can be purged, this can't be purged till i've exploded the block.

when I try layer merge it gets rid of my layer, but the Frame-5 layer still exists.  When I try to merge that I get a message stating Frame-5 couldn't be purged as an object in the drawing is referencing it.

Any Ideas

I've placed a copy of the file in my folder on the lilly pond, but I'm having problems linking to it at the moment.


I dunno dude, I just redefined the block (rotating it to 0) using the elements in the drawing and purged layer frame-5 without incident.

You know you can't purge the current layer, right?

CADaver

  • Guest
Block problem.
« Reply #12 on: September 23, 2004, 10:38:05 AM »
Try here

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Block problem.
« Reply #13 on: September 23, 2004, 10:42:33 AM »
Hudster,
Got you block drawing.
This is the only routine I have found so far that works.
It creates a COPY of the block but all to layer 0
Then I deleted the original block & purged all 3 times.
I believe you could use the code here to create a Block
replacement routine to do what you want.

Code: [Select]
;make a copy of a block with a new name
;select block to copy
;enter new name
;pick insertion point
(defun C:CopyBlock2 (/ *error* OldBlockName NewBlockName
    rewind BlockName Info BlockInfo ent_name ent_info)

(defun *error* (Msg)
 (cond
  ((or (not Msg)
       (member Msg '("console break"
                     "Function cancelled"
                     "quit / exit abort"))))
  ((princ (strcat "\nError: " Msg)))
 ) ;cond
 (princ)
) ;end error

  (sssetfirst)
  (setq OldBlockName (entsel "\nSelect Block to copy: "))
  (while
    (or
      (null OldBlockName)
      (/= "INSERT" (cdr (assoc 0 (entget (car OldBlockName)))))
    )
     (princ "\nSelection was not a block - try again...")
     (setq OldBlockName (entsel "\nSelect Block to copy: "))
  )
;block name
  (setq OldBlockName (strcase (cdr (assoc 2 (entget (car OldBlockName))))))
  (princ (strcat "\nSelected block name: " OldBlockName))
  (setq NewBlockName (getstring T "\nEnter new block name: "))
  (setq rewind T)
  (while (setq Info (tblnext "BLOCK" rewind))
    (setq BlockName (strcase (cdr (assoc 2 Info))))
    (if (= OldBlockName BlockName)
      (setq BlockInfo Info)
    )
    (setq rewind nil)
  )
  (if BlockInfo
    (progn
      (setq ent_name (cdr (assoc -2 BlockInfo)))
;header definition:
      (entmake (list '(0 . "BLOCK")
      (cons 2 NewBlockName)
     '(70 . 2)
      (cons 10 '(0 0 0))
       )
      )
;body definition:
      (entmake (cdr (entget ent_name)))
      (while (setq ent_name (entnext ent_name))
 (setq ent_info (cdr (entget ent_name)))
 (entmake ent_info)
      )
;footer definition:
      (entmake '((0 . "ENDBLK")))
     (command "-INSERT" NewBlockName pause "1" "1" "0")
    )
  )
 (*Error* nil)
 (princ)
) ;end
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Andrea

  • Water Moccasin
  • Posts: 2372
Block problem.
« Reply #14 on: September 23, 2004, 11:03:38 AM »
did you tied..

XPLODE or BURST ??
Keep smile...

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Block problem.
« Reply #15 on: September 23, 2004, 11:22:19 AM »
The layer is defined ureferenced in the block (as is probably all of the offending layers) ...

A neat trick I used to use is to create a block with no graphical entities, then insert that block into AutoCAD... the user cannot select it without programming and the layers cannot be purged.

My thought is this ...
Whoever the culprit is that defined the blocks (or edited them later) failed to purge the unneeded entities before saving the drawing. After being inserted the block then becomes problematic when you want to delete layers ....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Block problem.
« Reply #16 on: September 23, 2004, 08:38:52 PM »
If you want to take a look inside the block to see where the layer is hiding
try this routine. It creates a text file called "Block Date-[block name].txt"

The problem as I see it is the parent block can not be modified and the layer
can not be changed without recreating the block. And as Keith pointed out there
are other hiding places for layers.

http://theswamp.org/phpBB2/viewtopic.php?p=15092#15092
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Block problem.
« Reply #17 on: September 23, 2004, 08:57:02 PM »
You may want to try this routine on a few. It will fix some blocks.

Code deleted:

FixBlock does the same thing with more error checking, sorry but I tried. :oops:
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

hudster

  • Gator
  • Posts: 2848
Block problem.
« Reply #18 on: September 24, 2004, 04:34:06 AM »
I ran the copy block lisp and I've now got it down to 3 layers.

Weird thing is i copied the drawing and deleted everything, inserted each block in turn and purged the drawing each time, and that layers always disappeared, but when they are all together I can't purge these 3.

Looks like i'll have to live with them, as I can't think of anyway to find out what is referencing these layers.

I wish autocad would come up with a way to show all the blocks and their properties, layers etc in a comprehensive list.

***edit***
I've got it down to one layer now.

Some how the architcet has managed to create blocks that begin with a *, i.e. *17, I didn't think this was possible?

But I was clicking around the drawing and found one, used the copyblock lispp and had to delete the *17 block, AutoCAD won't let me use replaceblock on a block with a * in the title, and got rid of two layers.

One to go.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Block problem.
« Reply #19 on: September 24, 2004, 08:24:51 AM »
blocks with a * as the first character are anonymous blocks and can be easily created by third party software.

FYI: Dimensions are considered blocks in the AutoCAD table and until the dimensions are all purged, the layers, blocks, and text styles used in that particular dimension are not purgable, nor is the dimension style. They will be shown in the block table as *Dxx where xx is an integer.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie