Lisp to move overlapping blocks into a spiral array of non-overlapping blocks

Lisp to move overlapping blocks into a spiral array of non-overlapping blocks

Anonymous
Not applicable
773 Views
1 Reply
Message 1 of 2

Lisp to move overlapping blocks into a spiral array of non-overlapping blocks

Anonymous
Not applicable

Is anyone aware of a lisp routine that can identify overlapping blocks and move them one-by-one into a spiral array so that they no longer overlap?

 

I envision 3 user inputs:

  1. User to specify the block name or select an instance of the block
  2. User to specify the "overlap" threshold (threshold = 0 means instances must share the same XY coordinates)
  3. User to specify the distance each block should be moved

I've provided a Before/After visual example of 8 overlapping blocks being "spiral arrayed" below:

BeforeBefore   After (numbers shown for clarity only)After (numbers shown for clarity only)

I greatly appreciate any and all help. Thank you!

 

0 Likes
774 Views
1 Reply
Reply (1)
Message 2 of 2

dlanorh
Advisor
Advisor

Use the vla-getboundingbox method to get the extents of the block, lower left and upper right corners. The upper left and lower right corners, width and height can then be calculated from these. Using the width, height and the correct corner (depending on whether the spiral is clockwise or ccw) will allow the spiral array to be formed.

I am not one of the robots you're looking for

0 Likes