Hi All
What I am trying to do is figure out the steps to "reset" geometry within blocks. (Assuming rectilinear).
That is to say find the min X value and Y Value and align that with the 0,0 of the block. To be able to do this on a drawing full of blocks. Essentially fixing poorly defined blocks whose origins are miles/km's away!
Any ideas?
Thanks in advance.
Shaun
@shaunfarrell5867 wrote:....What I am trying to do is figure out the steps to "reset" geometry within blocks. (Assuming rectilinear).
That is to say find the min X value and Y Value and align that with the 0,0 of the block. To be able to do this on a drawing full of blocks. Essentially fixing poorly defined blocks whose origins are miles/km's away!
....
If all such Block insertions are at scale factors of 1 and the same rotation [big if, huh?], I can imagine a way to do it [which I have, in fact, done manually a few times under those circumstances, but not with a routine]:
Select a Block insertion.
Save its Block name and [old] insertion point.
Get and save the desired [new] insertion base point relative to the Block's content.
Copy the Block in place, and Explode the copy.
Define the Block again, using the same name, the Exploded pieces [Previous selection after Exploding], and the new insertion point, answering Yes to the question of whether you want to redefine it, and deleting the pieces in the process.
Find all insertions of that Block, and Move them from the old insertion point to the new one.
But if some already-existing insertions are scaled differently, or rotated, they won't be moved appropriately. Maybe you could go through the set and Move each one individually, making compensation for those differences -- that could be some tricky code, but it's probably doable.
Another possibility would be to place a Point or something at the desired new insertion point, Move the Exploded pieces from there to the old insertion point, and redefine the Block using the Exploded pieces and that Point. That would at least give you a Point that you could move each Block's insertion point to, regardless of scales and rotation, but you'd have to do them individually. Then once they're all repositioned, you could redefine the Block to remove that Point.
You could use my Change Block Insertion program to change the base point of your blocks without changing their position in the drawing (CBIR).
You would only need to select one Insert for each block you want to change, and the change will be reflected across all other insertions of the block.
Lee
@Kent1Cooper wrote:Select a Block insertion.Save its Block name and [old] insertion point.
Get and save the desired [new] insertion base point relative to the Block's content.
Copy the Block in place, and Explode the copy.
Define the Block again, using the same name, the Exploded pieces [Previous selection after Exploding], and the new insertion point, answering Yes to the question of whether you want to redefine it, and deleting the pieces in the process.
Find all insertions of that Block, and Move them from the old insertion point to the new one.
But if some already-existing insertions are scaled differently, or rotated, they won't be moved appropriately.
Kent,
I think Exploding is out of the question since all attribute values would be lost, along with any dynamic block functionality.
Lee, Kent is talking about exploding an additional inserted block and not one that is all ready in the drawing. I have done this on occasion to fix problems with blocks and such.
@Anonymous wrote:Lee, Kent is talking about exploding an additional inserted block and not one that is all ready in the drawing. I have done this on occasion to fix problems with blocks and such.
But as soon as you explode/redefine it, you will lose any Dynamic Block functionality.
I don't use Dynamic blocks, have seen to many issues when trying to export down to lower versions of software, just like Annotative text. Yes, they are nice, but when I have to go back and fix or redo stuff to export down, it defeats the purpose of them. And I have to export down a lot these days. I know it shouldn't be my problem if someone doesn't upgrade their software but when you have spineless Engineers and Project Managers that don't want to argue with a sub-contracter who still is using R14 or another version and there this is a deadline to get a task completed. I have always been to downgrade my drawings to get the problem solved to meet said deadline.
@Anonymous wrote:I don't use Dynamic blocks.
You don't, but the OP might.
True, but usually they state if it is a dynamic block. The more info they provide up front the better help they will get. Have a good one, have enjoyed the back and forth banter.
I have to admit I was just keeping things easy. The essence of this was to be able to fix/create block library containers. Where there is only once instance of the block, no rotation but geometry has been made either miles away from zero or in some "odd spot". At the moment its open one in block editor, zoom extents, construction lines from XY, move to origin and close block editor. I wanted to throw it out there to see if there is a more "programmatical" method. Even if this only takes a minute or two per block, it soon extrapolates out. As one poster mentioned, this is looking at simple R14 style blocks without adding complexity. It will also only work for blocks where bottom left makes sense, lets not even start on the centroid question 🙂
Shaun,
As they say be careful what you ask for. Lee's program is pretty good, I would give it a try. I hate it when people don't give good thought on creating a block in their current drawing with a good insertion point. I myself have tackled such a task in the past and it was no joy.