Thread: What's happened to this block?
|
Replies:
7
-
Last Post:
Mar 4, 2009 11:35 AM
Last Post By: Joe Burke
|
|
|
Posts:
27
Registered:
03/09/03
|
|
|
|
What's happened to this block?
Posted:
Mar 2, 2009 12:30 PM
|
|
|
|
|
|
I received a drawing the other day from an architect and set about cleaning things up a little so it could be used as an xref. The drawing appears to have originated from Microstation but I'm not entirely sure of what kinds of processes it has been through before landing on my desk. Everything was OK until I tried to do some work on some blocks in the drawing. I have attached a drawing with just one of the blocks in it but the drawing contains many similar examples and I can't seem to do anything with them. If you check the properties of the block it's name would suggest it is anonymous with the * prefix. If you then go to insert a block you will note that the drawing contains just one block and it is the block shopwn in the drawing but it has a legitimate name. If I then insert a new instance of the block it comes in looking no different than the one already there but if I again check the properties of the original insert it has a scale factor of 0.001 in all planes whereas my new insert has a scale of 1 - but both view exactly the same. The original also has an odd insert angle which doesn't relate to what is being shown on screen.
If I use the RENAME command it allows me to rename a block but this isn't reflected in the properties and if I do an entget, this also shows the 'anonymous' name. It's not possible to explode or burst the block and on the whole it seems to be even more confused than I am!!
Can anybody shed some light on how I can reinstate this kind of block back into something slightly more functional than it currently stands? The original drawing has around 80 similarly affected blocks of different varieties and ideally I don't want to have to redefine and reinsert everything - with all the current squiffy angles etc it wouldn't be just a simple matter of globally replacing stuff.
Any advice or insight offered would be greatly appreciated.
|
|
|
|
|
|
|
|
Re: What's happened to this block?
Posted:
Mar 3, 2009 9:15 AM
in response to: mister_nick
|
|
|
|
An annonymous E block is created when AutoCAD cannot explode a block for some reason. The reason may be the block is slightly non uniformly scaled.
That's the case with the *E1 block in your example. Select the block and in Properties enter .001 for each of the X, Y and Z scales. The block should be explodable after that. And the scale of the nested block S3420_2 will be X 1.0, Y -1.0, Z 1.0.
I hope this sheds some light.
Joe Burke
|
|
|
|
|
Posts:
27
Registered:
03/09/03
|
|
|
|
Re: What's happened to this block?
Posted:
Mar 3, 2009 10:29 AM
in response to: Joe Burke
|
|
|
|
Thanks Joe. I hadn't thought to alter the scales - I just saw that they were each shown as the same and assumed that it couldn't be the NUS aspect that was causing the trouble. Just goes to show that assumption can be your worst enemy at times :o(
|
|
|
|
|
|
|
|
|
Re: What's happened to this block?
Posted:
Mar 3, 2009 11:03 AM
in response to: mister_nick
|
|
|
|
You're welcome.
Let me know if the code in my other message helps.
Joe Burke
|
|
|
|
|
|
|
|
|
Re: What's happened to this block?
Posted:
Mar 3, 2009 10:19 AM
in response to: mister_nick
|
|
|
|
Something like this *might* work to get rid of all the annonymous E blocks.
Joe Burke
[code] (defun c:FixAnnonE ( / i ss e obj name xscl) (vl-load-com)
(defun round (value to) (if (zerop to) value (* (atoi (rtos (/ (float value) to) 2 0)) to)))
(setq i 0) (if (setq ss (ssget '((0 . "INSERT")))) (repeat (sslength ss) (setq e (ssname ss i) obj (vlax-ename->vla-object e) name (vlax-get obj 'Name) ) (if (wcmatch name "`*E*") (progn (setq xscl (vlax-get obj 'XScaleFactor) xscl (round xscl 0.001) ) (vlax-put obj 'XScaleFactor xscl) (vlax-put obj 'YScaleFactor xscl) (vlax-put obj 'ZScaleFactor xscl) (command "._explode" e) ) ) (setq i (1+ i)) ) ) (princ) ) ;end [/code]
|
|
|
|
|
Posts:
27
Registered:
03/09/03
|
|
|
|
Re: What's happened to this block?
Posted:
Mar 4, 2009 3:15 AM
in response to: Joe Burke
|
|
|
|
Joe,
Just to let you know that I ran your code on the original drawing and it did indeed fix all the blocks for me. Not sure if I'll ever need to use the code again as this has been the first time I've ever encountered such an issue but it's certainly a snippet to keep in the armoury - you never know when it may come in handy again.
Thanks for your help on this one :o)
|
|
|
|
|
|
|
|
|
Re: What's happened to this block?
Posted:
Mar 4, 2009 11:35 AM
in response to: mister_nick
|
|
|
|
Nick,
You're welcome and glad to hear the code worked.
Joe Burke
|
|
|
|
|
Posts:
27
Registered:
03/09/03
|
|
|
|
Re: What's happened to this block?
Posted:
Mar 4, 2009 3:15 AM
in response to: Joe Burke
|
|
|
|
Joe,
Just to let you know that I ran your code on the original drawing and it did indeed fix all the blocks for me. Not sure if I'll ever need to use the code again as this has been the first time I've ever encountered such an issue but it's certainly a snippet to keep in the armoury - you never know when it may come in handy again.
Thanks for your help on this one :o)
|
|
|
|
|
|
|
|