Dynamic Block based on xy coordinate of center of arcs.

Dynamic Block based on xy coordinate of center of arcs.

BWYarger
Collaborator Collaborator
1,175 Views
15 Replies
Message 1 of 16

Dynamic Block based on xy coordinate of center of arcs.

BWYarger
Collaborator
Collaborator

I have drawings that I need to convert to dynamic blocks.  It is a reverse curve arrow in a traffic warning sign.  I can do almost everything, but the curves are based on the center of the arcs, which are not proportional when scaled.  The angle of the middle section and the lengths of the arcs should change as the location of the center of arcs move.  I also have looked into parametrics, but can't figure out how to make this happen.  Pretty much everything is based on three dimensions, the width of the arrow shaft, and the location of the center of the two arcs.  The arrow head should remain the same shape and be proportional to the shaft width.  I have gotten this to work for a reverse turn sign where shaft sections are perpendicular.  I have also gotten parametrics to sort of work when the arcs are circles, but not when the arcs are acs.  The bottom portion works, but the top distorts the arrow head instead of moving as a block.  I assume the answer is a combination of both parametrics and dynamic blocks.  I have attached a drawing file.

Brad
LT, C3D 2005 - 2026
Windows XP, Vista, 7, 10, 11
0 Likes
Accepted solutions (1)
1,176 Views
15 Replies
Replies (15)
Message 2 of 16

Libbya
Mentor
Mentor

I don't think you've given enough information to make any useful guesses.  There are no dynamic blocks in the posted file.  There are some constraints.  How do you want the dynamic block to behave?

0 Likes
Message 3 of 16

BWYarger
Collaborator
Collaborator

It appears that the body of my original post didn't go through.

 

Attached is the drawing file with some parametric constraints.  I need to convert it to a dynamic block where I can move the center of the arcs and it responds accordingly.  The drawing is the arrow in a reverse curve traffic warning sign.  See the attached PDF.  The diagonal portion of the shaft needs to change its angle and length as the upper and lower portions are moved based on the center of the arcs.  The drawing has circles instead of arcs and I can get at least the bottom portion to work the way I want, but I can't have circles in the final drawing; they must be arcs that stretch and shorten as needed.  I believe I should make the arrow head into a block and nest it so that it moves as one.  The resultant dynamic block would allow the entry of the xy coordinates of the arcs centers.  The entire block would also scale based on the thickness of the shaft. 

 

I have the reverse turn arrow dynamic block working as it should, but in it the center portion of the shaft is perpendicular to the top and bottom portions of the shaft.  In the reverse curve the angle of the center sections is variable, as are the lengths of the center section and arcs. 

Brad
LT, C3D 2005 - 2026
Windows XP, Vista, 7, 10, 11
0 Likes
Message 4 of 16

Libbya
Mentor
Mentor

There are only 5 versions shown on the pdf.  Is there a reason not to just draw them and select via visibility?  If that is workable, then it is a lot less work than trying to make a parametric version work.  Add a flip parameter/action for the other direction.  

0 Likes
Message 5 of 16

BWYarger
Collaborator
Collaborator

If this were a one time thing, I would do them individually, but I am trying to learn how to do this at the same time. 

Brad
LT, C3D 2005 - 2026
Windows XP, Vista, 7, 10, 11
0 Likes
Message 6 of 16

j.palmeL29YX
Mentor
Mentor

Your table in the "Warning 5.pdf" includes some errors (e.g. dimension "J"). And also you have added too much dimensions (the shape would be over constrained if we would use all given dimensions): 

- If we know M and P and N, we don't need the dimensions for the radii, they are the result of F=P+M-N and J (the J in the picture)= P-N. 

- if we know D we don't need the dimension E. 

- G is for me not meaningful (?)

 

Attached an attempt how you get a stable shape. For the horizontal position of the arrow I used the dimension D. If you urgently want to use the position of the center points of the arcs you must add a dimension for the X-position of the center point of the upper arcs and must delete the dimension D. 

 

For the arrow head I added d1, d2, Win1 and Rad1, depending on M. 

 

After adding all geometric and dimensional constraints I created a block property table to put all needed values.  Even if I don't know where your partly "crooked" values come from, I have taken them unchanged from your template as good as possible. You can correct them as needed. 

 

I hope this block works as you expect. 

 

BTW: In your first posting above you wrote:  "I assume the answer is a combination of both parametrics and dynamic blocks."

NO no no. For driving the geometry I'd urgently suggest never to mix dynamic parameters and actions with geometric and dimensional constraints. Use either completely only the one method or completely only the other method. Otherwise the block will fail in most cases. 

That means, if you solve your issue using constraints (as I did here), you can not add the flip parameter and action. 

If you need the sign flipped, you can either mirror the inserted block reference, or you add in the block definition a mirrored variant of the existing geometry and constraints and change between both using two visibility states. 

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 7 of 16

BWYarger
Collaborator
Collaborator

First, thanks for your help.  I really appreciate it.

 

The PDF is from the US Federal Highway Administration.  I saw the errors too, but attached the PDF to my post anyway so you see what I am working with.  They have other signs with errors too.  I saw that J didn't make any sense.  I think it was for the arrow height measured from the center which doesn't actually have a label and falls within the reasonable limits.  The A is for the size of the diamond shape sign, not the arrow height.  I believe the center of the arcs is where G is given, not on the center of the sign.  Dimension F should be from G, not the sign center line. 

 

In this case I can use D to locate the arcs horizontally, but I need a vertical dimension since the shaft coming out of the arc can stretch up and down based on the tip of the arrow head location. 

 

I can't get your parametric constraints to show.  As I said, I am just trying to learn how to use parametric constraints so I there are things I don't understand about your drawing.  How do I show the constraints you used?  I tried the "show all" in the geometric and and dimensional sections of the parametric ribbon, but nothing appeared.  I am using 2018 right now, but have newer versions if this is something newer.

 

My bigger issue is how to make lines tangent to an arc and the arc length stretch to the point where the line is tangent when the arc center moves, or the line changes direction?  I get it to work with circles and lines since the circles don't have to stretch.  I have actually gotten this to work in a dynamic block based on an angle dimension and rotation action, but for this arrow I would have to solve for the angle given the other dimensions since the center shaft angle is not specified in the FHWA table in the PDF. 

 

I need to go and won't be back until Monday.  Thanks again for your help.

 

 

Brad
LT, C3D 2005 - 2026
Windows XP, Vista, 7, 10, 11
0 Likes
Message 8 of 16

j.palmeL29YX
Mentor
Mentor
Accepted solution

@BWYarger wrote:

 

 

My bigger issue is how to make lines tangent to an arc and the arc length stretch to the point where the line is tangent when the arc center moves,  


 

Some basics:  (>>Click<< )

 

- draw a rough sketch of what you want your shape to look like (in this example line arc line arc line). It may be drawn precise, but that is not necessary.
- add the needed geometric constraints. The lines vertical, the endpoints between the lines and the arcs coincident and also tangential constraints between the lines and the arcs. Now you have a stable figure where the outer lines are always vertical and the arcs touch the lines tangential. (BTW: You can avoid having to create the coincident constraints by not drawing single lines and arcs but, if possible, a polyline - as I did in my first attempt above too)
- in order to get a full defined geometry, at last the dimensional constraints must be added.
It is usefull to have anywhere a fixed point. Either an explizit drawn point (as I did here, similar to the requests for your sign) or any point or object of your existing geometry.
If you add the dimensions for the center points of the arcs (d2/d3 and d4/d5) you must explizit activate the "CEN" osnap. AutoCAD can not find the center point automatically by picking the arc (unless the arc angle is greater than about 230°. Do you know or understand you why? 😉 ).
Now you can add either rad1, then you can not add the horizontal dimension from the fixpoint to the left vertical line. OR you add the horizontal dimension (d7), then you must not have the rad1 dimensioned (otherwise the geometry would be over constrained, because d3+rad1=d7). Only two of these three dimensions are necessary and allowed. Which both of them you use (or which one you delete) is your choice. Instead of deleting a dimension you also can set it to a Reference dimension. Such dimensions are driven by other dimensions and constraints, they can not drive the geometry. So they are useless, because Reference dimensions also can not used in other expressions. (The same of course with d5, d8 and rad2).
Now you can play with the positions of the center points (d2/d3, d4/d5) and the height (d1, d6).
The figure will follow your dimensions, the arcs stay tangential connected to the three lines.
How to use that in a block definition I will show in a next video.

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

Message 9 of 16

j.palmeL29YX
Mentor
Mentor

How to use parametric constraints in block definitions?
>>Here<< I will continue the previous video.

Create a new block definition, insert all needed geometry as usual.

In the block editor you will see all geometric and dimensional constraints. You can manipulate the constraints as shown before. If you leave the block editor you will see in the inserted block reference the changed geometry, but you will not (and never) see neither the geometric nor the dimensional constraints (which were created with the dc... commands).
If you want to modify the geometry of block references, you must use (instead of the dimensional constraints) constraint parameters (bcparameter command).
In the video I deleted all dimensional constraints and added instead the needed parameters. In the block references you now can change this parameters either dragging the grips, or change their values using the properties window or a block definition table. (if you don't need the grips you can change their number to 0).

Of course you can (and in most cases you will) define such blocks directly in the block editor. It si not necessary to create dimensional constraints first and then substitute they with the parameters.
For all dimensions which will be constant in all block references you should use dimensional constraints (dc...). They are invisible in block references. For the dimensions which must be variable use the constraint parameters (bcparameter).

A last note: Avoid to place more than one grip (if you want to drag the geometry with grips) at the same place. In the block reference mostly you will have access only to one of them. 

 

 

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 10 of 16

BWYarger
Collaborator
Collaborator

Thank you!  The video is extremely helpful!  I wish I could have found one like that before.  I recommend you add voice and post it on YouTube.  All of the YouTube videos I found were very basic and the tangent constraint was to circles, not arcs that needed to stretch.

 

As for your question, I didn't know that 230 degrees is the magic number on arcs, but I usually run with numerous osnaps including center on at all times, and briefly pause them when needed.

Brad
LT, C3D 2005 - 2026
Windows XP, Vista, 7, 10, 11
0 Likes
Message 11 of 16

j.palmeL29YX
Mentor
Mentor

@BWYarger wrote:

I didn't know that 230 degrees is the magic number on arcs, 


 

It is not a mystical number or any other mystery 😉  , it is just a simple basic rule in AutoCAD. >>Click<< 

Whenever AutoCAD finds several possibilities, it chooses the closest one. This is similar to running object snap e.g. if End and Midpoint is active. AutoCAD always chooses the point that is closest to the pick point.
Likewise here: On an arc, for adding a coincidence constraint, AutoCAD can choose the two endpoints, the midpoint, and the center point- and as above it chooses the one closest to the pick point. But If the angle of the arc is small, the distance from a pick point to the center point is always greater than the distance to an end point or the center point. Only at an angle of more than 230° is there a small area (about the half way between end- and midpoint) where the distance to the center point is less than the distance to the end or center point and can be used directly by picking the arc. If the arc is too short, you can force the center point to be found by explicitly activating CEN. (Only to activate the running object snap CEN, is not enough).

 

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 12 of 16

BWYarger
Collaborator
Collaborator

Thank you for the explanation of the osnaps.  I find that with multiple I can move my cursor around to get it to show the center, and then pick it, but never really paid attention to the details.

 

I am still having problems with my parametric constraints.  Your block works, but I can't get mine to work primarily with the arrow head.  It wants to distort when I want it to stretch the upper vertical portion of the shaft.  The lower two thirds work fine.  I see you have a lot of symmetric constraints and a horizontal point, but I don't quite understand what you did.  When I highlight the constraint, the pairs don't make sense.  It is highlighting one item and an opposing item on the other side the symmetry line that isn't like the first, such as a line and an opposing arc.  I have attached a drawing not using the block editor at this point because I hope it would be easier to learn without involving blocks on top of everything else.  When I change d6, the arrow head scales instead of moves and stretching the shaft just below.  I added some more constraints and now the arrow head distorts symmetrically.  Is there a constraint that locks the angle of a line at other than horizontal or vertical?  The arrow head shape shouldn't change, just scale proportionally to the shaft width, d5.

Brad
LT, C3D 2005 - 2026
Windows XP, Vista, 7, 10, 11
0 Likes
Message 13 of 16

j.palmeL29YX
Mentor
Mentor

@BWYarger wrote:

 

I am still having problems with my parametric constraints.  


Allow me at first to make a few remarks on the subject of symmetry. (>>Click<<)
If we add a symmetry constraint to two circles it works well. But if the objects are lines or arcs they are perhaps "symmetrical" (I do not want to argue about the term), but in most cases we don't expect this "symmetry", we expect two objects which look as they would were mirrored.
Therefore I prefer, not to add the symmetry constraints to two objects, but to points on the objects. For lines either the two endpoints or an endpoint and the midpoint. For arcs we need three points for an unambiguous geometric description. I'd suggest the endpoints and the midpoint (not the center point).
So you will get really symmetrical geometry which looks as mirrored. 

I hope this will help you to repair your block. 

And of course you must delete the fix constraint of your symmetry line (otherwise you can not move the arrow horizontalla) and must add a vertical constraint to this line. 

 

BTW: I's suggest never to draw on the Defpoints layer. AutoCAD uses this layer for internal purposes. For the user, hand off this layer. 

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 14 of 16

j.palmeL29YX
Mentor
Mentor

Now the continuation. 

>>Here<< a suggestion how you can get what you expect: 

- delete the sym. constraints on the Symmetry line

- delete the fix constraint 

- add a vertical constraint to the Sym. line 

- add a coincident constraint between Sym. line and top point

- add new sym. constraints between the points

- add a missing tangential constrains at the right

- add a missing angle constraint

 

Now the arrow is full constrained and works well, but it doesn't change its size depending on d5 (as you want). 

The dimensions d7, d8 and rad5 must not be an explicitly number, but should be an expression "factor*d5". 

I used the current values and calculated the factors (approximated) "current value divided by 7" (the current value of d5). Of course you can use other factors. 

I hope with this modifications your geometry should work as expected now (I did not a deep testing). 

Perhaps you should consider another definition for d4, that's your choice ...

 

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 15 of 16

BWYarger
Collaborator
Collaborator

Thank you.  I now have it working to at least the point of moving the arrow head instead of distorting it.  My main problem was I didn't see (and still don't see your) angle constraint.  I felt like that was the issue, but was looking for a geometric constraint to fix the angle instead of a dimensional constraint. 

 

Are there angle constraints in your block that aren't visible?  How about dimensional constraints for the other three sides of the sign and corner radii that aren't visible?  I see three of the radii are set equal, but not the fourth.

 

I also changed some of the dimensions to formulas as you suggested based on the shaft width, d5. 

Brad
LT, C3D 2005 - 2026
Windows XP, Vista, 7, 10, 11
0 Likes
Message 16 of 16

j.palmeL29YX
Mentor
Mentor

@BWYarger wrote:

 I didn't see (and still don't see your) angle constraint.   


 

Allow me to digress a little. 

In a block definition (in the block editor) you have two possibilities to add dimensional constraints.

- You can use the DC... commands (dclinear, dcaligned, dcradius and so on). You find these commands by others in the "Parametric" tab. The result will be dimensions (Linear Dimension, Aligned Dimension, Radial Dimension, ...). These dimensions are are never visible in block references (as long as you don't change its Constraint Form Property to Annotational). They can not be used for dynamically changing the geometry of the block reference. Only in the block definition you can see this dimensions, and that also only if their visibility is ON (command dcvisible->show,  or use dcvisible->hide if you don't want to see them). [And of course you can see this dimensions in the model space if you explode an inserted block reference.]. 

These DC... commands (as well as all GC... commands for the geometrical constraints) can also be used in the Model space. 

 

- In the block editor (and only here) you can also use  the bcparameter command (with the options linear, aligned, radius, ...). You find this command(s) in the BlockEditor Tab. The result will be Constraint Parameters (Horizontal Constraint Parameter, Aligned Constraint Parameter, Radius Constraint Parameter, ...). These parameters look very similar to the Dynamic Parameters which you create with the BParameter command. But these Parameters including their associated actions have nothing to do with the constraint Parameters and should never used side by side  constraints in one block definition. )

The value of these Constraint parameters can be changed on the block References by dragging their grips, or by typing new values in the property window or by a block definition table or ... 

 

Summary: 

For dimensions of geometric objects which shall not be changed in the block references you should use the DC... commands. They are never visible in block references and can edited only in the block editor (in the block definition). 

If you want dynamically change the dimension of block references you should use the bcparameter command. 

 

Where is the angle constraint in my drawing? 

See >>video<<. The angle W1 will always be the same value, therefore I used the dcAngular command. (Never visible in a block references; in the block editor only visible (and editable) if you set dcvisible to show). 

Also for d1, d2 and Rad1 I used the dc... commands. The expression is always the same (even if an included parameter [d5] can get variable values). It would be a disaster, if a user would overwrite the formula with any other value. The block would be destroyed. 

 

I see three of the radii are set equal, but not the fourth.

The top arc is dimensioned. The left and the bottom arc got an equal constraint. The right doesn't need this constrained, because ist is tangential constrained to the both diagonal lines and its center point is is coicident constrained to the endpoint of  the horizontal construction line. so this arc is already full constrained. If you try to add an equal constraint you will get an error message which says "would be over constrained". 

 

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