Stacking blocks end to end vertically

Stacking blocks end to end vertically

ironchef31
Advocate Advocate
1,281 Views
5 Replies
Message 1 of 6

Stacking blocks end to end vertically

ironchef31
Advocate
Advocate

Sometimes I have drawings where there are gaps between blocks or they overlap.

I need to come up with some code that will let me window a group of blocks and stack them end to end from top to bottom.

The blocks must retain the same order vertically. The horizontal alignment can be at the insertion points (have the same X coordinate).

 

Before I start writing code, I was wondering if someone has some code that will get me mostly there.

 

Thanks

Ken

 

 

0 Likes
Accepted solutions (1)
1,282 Views
5 Replies
Replies (5)
Message 2 of 6

martti.halminen
Collaborator
Collaborator
Accepted solution

 

Most of that would be reasonably easy; the interesting part is detecting where is the end of a block.

I see three ways:

 

A) the blocks are known a priori to be the same size, for example coming from a known symbol library

 

B) the size of the block is recorded in the block when building it

- encoded in the block name, or in some hidden data: attributes, Ldata, Xdata, whatever.

 

C) the size is found by using the bounding box of the block

- general-purpose, but you occasionally get runaway bounding boxes depending on the contents of the block.

 

 

-- 

Message 3 of 6

ironchef31
Advocate
Advocate

I just finished the code.  it's not the most elegant but it works.

I opted to use the bounding box method.

0 Likes
Message 4 of 6

Anonymous
Not applicable

Hi,

 

I'm also similar situation. Could you please provide me the lisp.

 

Thanks,

Sai.

0 Likes
Message 5 of 6

ironchef31
Advocate
Advocate

Here you go.

cheers

ken

0 Likes
Message 6 of 6

Anonymous
Not applicable

Thank you so much

0 Likes