Author Topic: Matching block to specified size of rectangle  (Read 957 times)

0 Members and 1 Guest are viewing this topic.

notredave

  • Newt
  • Posts: 140
Matching block to specified size of rectangle
« on: November 08, 2021, 09:13:25 AM »
Good morning all,

I traced over a vendor drawing. It is the block on the right side of drawing (in red). I need that block to fit in correct dimensionsof rectang on left side (in white). The rectang is the correct dimensions I need. I do a scale with reference points from top left corner to bottom right hand corner of block and do points of rectang. It won't scale to the size of rectang. Does anybody have a lisp routine that will make the block in red match exactly the size of rectang? Any help would surely be appreciated.

ribarm

  • Gator
  • Posts: 3256
  • Marko Ribar, architect
Re: Matching block to specified size of rectangle
« Reply #1 on: November 08, 2021, 10:41:26 AM »
Is your red block insertion point position important to you, or it can be changed (now it's placed at ridiculous place that has no meaning IMHO)?
By changing position of blocks insertion point to for ex. lower left vertex of your rectangular shaped reference block, you'll be able to determine X coefficient and Y coefficient for matching destination rectangular shape you desire... Use command DISTANCE - pick lower left point of red block - pick lower right of red block (remember value); then use DISTANCE command and pick lower left of destination rectange - lower right and also (remember value)... Finally divide lastly remembered value with first one and that's X coefficient... Then just multiple X coefficient with X scale factor of red block and change that X scale factor to multiplied value... If red block had base point changed to lower left point and if that red block was placed so that lower left point (base point) matched lower left point of destination rectangle, after redefining X scale factor with calculated value (* X-coefficient X-old-scale-factor), red block width should be matched with destination rectangle width... The same can be apllied and for Y axis calculation... So finally you'll get red block matching white rectangle like you asked...

For changing block insertion base point, look at www.lee-mac.com and search Change blocks insertion point routine...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

notredave

  • Newt
  • Posts: 140
Re: Matching block to specified size of rectangle
« Reply #2 on: November 08, 2021, 11:38:43 AM »
ribarm,

Thank you for replying but I can get the x dimension to match white rectangle x but my y doesn't match when I do this.

I divided 19.4300 (rectang x) by 140.6776 (red block x) and x matched but y didn't. What if I make white rectangle into a block, is there any lisp that would work to match x and y?

Thanks again for replying but I'm lost.
David

ribarm

  • Gator
  • Posts: 3256
  • Marko Ribar, architect
Re: Matching block to specified size of rectangle
« Reply #3 on: November 08, 2021, 01:16:44 PM »
X and Y directions are not each other dependent...
You firstly change X scale factor of block by procedure explained...
Then you do the same with Y scale factor (you keep X scale factor you previously altered)...
Main thing is that base points for block and retangle is matching (lower left point)... Have you used Lee's routine for changing block base point?
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Matching block to specified size of rectangle
« Reply #4 on: November 08, 2021, 02:08:15 PM »
Within the Properties Palette, you can manually specify an x-scale factor of 0.1381 (= 19.43/140.6776) and a y-scale factor of 0.1508 (= 11.7/77.5678), then use the MOVE command to position the block appropriately. However, I agree with Marko that the block base point should ideally be repositioned to a more meaningful datum point.