Keep object inside dynamic rectangle

Keep object inside dynamic rectangle

jbadgleyU8XVA
Explorer Explorer
983 Views
10 Replies
Message 1 of 11

Keep object inside dynamic rectangle

jbadgleyU8XVA
Explorer
Explorer

I am working on a dynamic workstation for a manufacturing layout. I have a circle inside of a rectangle. The rectangle is the workstation, the circle is where the airline connection will be.

 

I've made the rectangle dynamic to be able to scale it in the x and y directions. I want to be able to reposition the airline connection anywhere within the table. The problem i am running into is limiting the movement of the circle to keep it inside of my rectangle.

 

Ive attached what i have currently.  

0 Likes
984 Views
10 Replies
Replies (10)
Message 2 of 11

h_s_walker
Mentor
Mentor

Constraints and parameters don't mix very well. I don't have full AutoCAD, but below is a screenshot of how I would try and go about it using dimensional constraints

hwalker_0-1727433360135.png

 

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 3 of 11

jbadgleyU8XVA
Explorer
Explorer

I am not sure i understand how to implement what you have shown. How do i get the max width to subtract the diameter?

0 Likes
Message 4 of 11

jbadgleyU8XVA
Explorer
Explorer
I am not sure i understand how to implement what you have shown. How do i get the max width to subtract the diameter?
0 Likes
Message 5 of 11

h_s_walker
Mentor
Mentor

@jbadgleyU8XVA See the link below

AutoCAD 2022 Help | About Parametric Drawing and Constraints | Autodesk

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 6 of 11

jbadgleyU8XVA
Explorer
Explorer

I can only get it to constrain the circle to a point, it doesn't allow a range of movement. 

0 Likes
Message 7 of 11

h_s_walker
Mentor
Mentor

@j.palmeL29YX Do you think you could help out. I don't have full AutoCAD

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 8 of 11

j.palmeL29YX
Mentor
Mentor

I assume @h_s_walker refers to a solution similar to the one shown here. 

 

 

You are welcome to test this block, but
- it is not very stable,
- it is sometimes awkward to use
- it “provokes” a lot of new problems
- in general, dynamic blocks with constraints have some serious disadvantages

=>
I would not recommend such a solution. (but unfortunately I don't know of a better one)

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 9 of 11

MMcCall402
Mentor
Mentor

I think I would approach this visually by making a non-plotting rectangle within the perimeter of the work area that designates the limit and include it with the stretch actions.  Then you can visually see if you're placing it beyond the limits, and even snap to the limit if needed.

 

 

 

Having it move automatically with a constraints setup might not give you the behavior you want all the time.  For instance, you may want to make the work area wider but keep the electric and air in the same location.  If they move with the width changes you'll need to move them back each time.  That may not be desirable.

 

Also, consider making your parameters 'incremental' such that your actions will only move to exact increments vs random values. (my inner ocd is showing)

 

Addition:  Interesting behavior I just noticed.  You can hold down the Shift key and select both the point parameter grip and the width, or height, grip and they'll move together.  This would give you the option to choose when the elec/air locations move with the height/width change.

 

MMcCall402_0-1727721522073.png

 

 

 

 

 

Mark Mccall 
CAD Mangler


EESignature


VHB - Vanasse Hangen Brustlin, Inc.


Linkedin

0 Likes
Message 10 of 11

jbadgleyU8XVA
Explorer
Explorer

Thank you for the solution you provided. It is a little buggy with moving things around, however it does accomplish what i am trying to do. It also helps me understand the parameter syntax better.

 

Do you know if you can enter a formula in the "Dist maximum" Property box? I added a picture to help clarify which box I'm talking about.

My first thought was to have my rectangle independent from the circle, set up as a normal dynamic rectangle. Then using a horizontal distance constraint I would setting the Dist min to 0 and the Dist maximum be equal to the length parameter of the rectangle. The same set up for the vertical constraint except the Dist maximum would be the rectangle width.dynamic block marked.jpg

0 Likes
Message 11 of 11

j.palmeL29YX
Mentor
Mentor

@jbadgleyU8XVA wrote:

Do you know if you can enter a formula in the "Dist maximum" Property box?


 

AFAIK only numerical values are allowed.

(the ability to use parameters in the property panel is one of my long whishes.) 

 

 


@jbadgleyU8XVA wrote:

It is a little buggy with moving things around,


 

I know.

Unfortunately constraints don't know an equivalent to the Point Parameter with an assoziated Move Action. My work around is the use of a vertical and a horizontal dimensional constraint on the same point. The problem - when you pick at this point AutoCAD decides sometimes to grab the horizontal, soemtimes the vertical and sometimes if you are in luck) both together (that is what we need).  Therefore I wrote above "it is sometimes awkward to use".  😉

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes