Moving blocks to near intersection point

Moving blocks to near intersection point

Anonymous
Not applicable
1,559 Views
5 Replies
Message 1 of 6

Moving blocks to near intersection point

Anonymous
Not applicable

Hello All

 

Could selected blocks be moved to nearest intersection point if a block base point is not on the intersection point?

 

I have a ceiling grid with blocks (light and HVAC)

 

Unfortunately, many of the blocks are not exactly located between ceiling grids; they are 1”~2” off from the grid line.

 

Is it possible to move the blocks to the grid line?

 

Only one condition would be, If a block base point (or location of the block) is further than 3” from the grid intersection point, it shouldn’t be moved.

 

It would be better showing which blocks are not moved at the end of the run for review.

 

There are many lisps to insert blocks at intersection, but it does not work with me since I need to move blocks to grid line.

 

Any Ideas?

 

Thank you.

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

Kent1Cooper
Consultant
Consultant

Is the reason you don't want to Move that one Block like its neighbors that you want its being out of position to be a cue that there's a grid line missing?  If so, it doesn't seem a very reliable approach.  Supppose that one happened to have been Inserted with its insertion point at the lower right, and with a rotation of 180 degrees -- then it would be moved, and you wouldn't get that cue.  Or if it was just a small fraction off, instead of a visually noticeable distance off, you wouldn't be able to tell except by Zooming way in -- would I be correct in assuming that's why you ask about showing which ones were not moved?

 

If the grid lines are always at "clean" multiples of some clean divisor of grid size in their X and Y coordinates, as in your sample, a routine could pretty easily be made to move all Blocks to place their insertion points at the closest multiple of 3" in both directions.  Then it wouldn't matter at which corner a given Block's insertion point was.  If you want to ensure grid lines along all edges of all such Blocks, you can build them into the Block definitions.

Kent Cooper, AIA
0 Likes
Message 3 of 6

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:

... move all Blocks to place their insertion points at the closest multiple of 3" in both directions. ....


If 'pt' is a variable containing a Block's insertion point as an XYZ coordinate list, this [based on something from Doug Broad years ago] will return the rounded-to-the-nearest-3"-multiple position, which you can then impose on the Block as its revised insertion point:

 

(mapcar '(lambda (a) (* 3.0 (fix (/ ((if (minusp a) - +) a 1.5) 3.0)))) pt)

Kent Cooper, AIA
0 Likes
Message 4 of 6

Anonymous
Not applicable

Hello Kent,

I totally forgot I can reset the origin and size of grid lines depending on the ceiling grid location and size. Then, yes, it would make more sense to align with grid line.

I was looking for other forum, and I found how to fix lines over the grid line; FixOffGrid.lsp(attached)  by Adam Wuellner 

http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quick-drawing-grid/m-p/1819703/highli...

The lisp works with only lines, however I think the principle of how the lisp should work might be similar.

However, with very basic knowledge of lisp, it is impossible for me to modify the lisp to work with blocks.

Could you lead me where I should look?

Also is it possible to set blocks to be aligned with grid line after they are inserted into the drawing?

I really appreciate any response and your time.

Thank you.

 

 

 

0 Likes
Message 5 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

... modify the lisp to work with blocks.

... 


FixOffGrid.lsp is already built to work with Blocks.  For the approach I suggested above, when it asks you to "Enter rounding value: ", give it 3.

Kent Cooper, AIA
0 Likes
Message 6 of 6

Anonymous
Not applicable

Hello Kent

 

.... I have nothing to say, not knwoing what i've found was for.....

 

Yes the lisp works for the blocks too ^^; which is great!!!

 

I don't know why i did not try on the blocks...

 

Thank you Thank you Thank you !!!! That is all i want to say. 

 

Have a wonderful day~~~

 

 

 

 

 

0 Likes