I am trying to create a dynamic block of a rectangle that is contained within a circle. The rectangle can be resized to any dimensions within the circle but cannot extend outside the circle. The rectangle must also always contain the center point of the circle just to make it a little harder. I have tried various combinations of constraints, stretch parameters with dimension limits, polar parameters with dimension limits but nothing quite behaves correctly.
Solved! Go to Solution.
Solved by dougfunke7850. Go to Solution.
Something like this perhaps as a start?
With this DynBLk you need to invoke NEArest ofter selecting the DynGrip to move along the circle at any point.
I am not savvy enough to add a Constraint to this to keep the Rectangle from extending beyond the circle
Regards, Charles Shade
CSHADEDESIGN | AUTOCAD LT | LT-KB | DYNAMIC BLOCKS
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
Yes, I went down that path. But the problem is that it needs to be "idiot proof" with some sort of constraint or length limitation to prevent the rectangle extending beyond the circle. I tried a polar stretch (See Attached) that had a limit of the radius of the circle but for some reason it allowed the other corners of the rectangle to extend beyond the circle when I applied a vertical constraint to keep it from rotating. The vertical constraint makes the box get smaller every time it is resized. Is there a way to limit the length of from the center of the circle to each of the rectangle corners all at the same time?
Are you wanting all four corners of the rectangle to always be coincident with the circle? Are you wanting the rectangle to be able to be able to be small and moved around inside the circle without it touching the circle? Do you want the centroid of the rectangle to be coincident with the center of the circle? Do you want the sides of the rectangle to always be horizontal/vertical?
Sadly I am trying to accomplish the second option. The rectangle can be any size as long as all 4 corners are inside the circle. I'm thinking this might be possible with chaining parameters but my results with chaining are not good.
Just before you posted I edited with a couple other pertinent questions.
The centroid of the rectangle does not need to be the center of the circle. But the center of the circle should always be contained within the rectangle. It would be desirable for the rectangle to rotate but I can accomplish that by rotating the entire block after the sizing is done.
I do not know of any way to do what you desire with stock autocad and I do not actually believe there is a way. I'd be happy to be wrong, though.
Was there a solution if the centroid of the rectangle was required to be the center of the circle?
Yes. but once the centroid of the rectangle is no longer the center of the circle, I know of no way to limit the rectangle to the limits of the circle.
See the attached file. The one on the left does not have centroids matching and in playing with it I am sure you will see how it fails. The one on the right does have centroids matching and it does not fail.
Thanks. I will proceed with this as the best possible solution. And I will have to digest the solution a little while to determine how the chained actions are working to provide the desired result.
Kudos for out of the box thinking. It is perfectly acceptable for this application for the circle to move as long as it still contains the rectangle and does not grow beyond a certain diameter. I still have not figured out the constraint you used to keep the corners of the rectangle coincident with the perimeter of the circle. A clue to that trick would be appreciated. I modified your drawing a bit to change the controls to be 2 polar stretches with distance limits. They also have angle limits that keep the center of the circle within the rectangle. The grip in the top right seems to work correctly but the one in the bottom left does not stay on the corner of the rectangle. Maybe the constraints are preventing that? I case the "real world" application of this will help with the solution, the circle represents the coverage area of a smoke detector (15 foot radius). The rectangle represents the walls of a room served by the smoke detector. As long as the room resides inside the circle, it has smoke protection. So if someone can figure out what I did wrong with the lower left grip and can find a way to keep it on the lower left corner of the rectangle I will be all set.
Libbya has the answer:
Open his block in the BE.
Make Distance1 Parameter Dist Type Increment from 0 to 15' in the Properties window (or however you change these variables)
Add a Scale Action to the Circle using Distance 1 Parameter as the parameter.
Voila.
Cool stuff. Love the chained XY
Regards, Charles Shade
CSHADEDESIGN | AUTOCAD LT | LT-KB | DYNAMIC BLOCKS
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
Can't find what you're looking for? Ask the community or share your knowledge.