Hi there,
I'd like to return LT for left direction curve or RT for right direction curve in a curve label style.
Can anybody help me with a formula for an expression to determine whether a curve is left or right direction curve?
Thanks!
Andrew
Hi Andrew,
Try this:
Joe Bouza
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.
There are General Segment Start Direction, General Segment End Direction, and Curve Chord Direction fields, however, these return azimuths or bearings depending on settings; there is also a General Segment Total Angle value that always returned a positive angle value when i tested it... The first two fields are the ones you must therefore use to calculate a signed delta value (unless I'm missing something here?), which may then be used to determine whether the curvature is oriented to the 'right' or to the 'left'. Because we cannot generate text values in expressions, we must add text components for both options to the curve label style and use the expressions to control text height...
alignment entities(arcs) in API Civil 3D has the bool property: Clockwise.
However, we cannot get this property in the expression.
This is one thing that I ordered in Civil 3D ideastation.
I wanted to get this for reports because in Spain is typical adding a minus (-) symbol in the Radius if the curve is to the left. Report of that curve: -Radius.
(This is an idea for Visual Report Designer 🙂 )
I don´t know if we can get a "bool" clockwise from the start and end direction.
There is a easy way to know if a curve is Right-hand or left-hand.
If we were able to get the center point of the arc and the (start or end point of the arc), then we could check if the center point is on the left or on the right.
If the center point is on the left (negative offset), then the curve turns to the left.
Hi Joan,
That would only work for some arcs... consider a 180-degree arc.
This could possibly be solved using vectors, though I haven't looked at this in sufficient depth to see whether the necessary fields are exposed (I think there may be some problems there which could be difficult to resolve via expressions). Regardless, to simplify the expression, I suggested using a signed delta based on start and end directions, however, there is very likely still an issue with this as well depending on how the angles/directions are presented and where the curve endpoints are located. For example, if the curve is starting in Q4 and ending in Q1, the expressions I suggested may fail as presented. In order to implement a robust solution, one would need to work through the various scenarios (including 180-deg curves, which may be problematic in any approach given the available fields) and determine what angle corrections need to be made, etc. The reason I left it simplified was to emphasize the technique for turning the text 'RT' and 'LT' on/off...
[Edited: corrected a few items...]
Yes, with expressions it´s very dificult.
with Civil 3D API, we only need the start direction and the coordinates of the center point.
The start direction of the arc will be a ray,
From the center point, we create another ray (start station+100 gon) to be ortoghonal.
Then we find out the intersection point between both rays and then we calculate the offset length. According on the sign of the offset, then the arc is right-hand or left-hand.
Here's a simple label using the expressions required. These will work for a curve less than 180 degrees. You can also create almost the same expressions for generic curve labels.
Steve
Please use the Accept as Solution or Kudo buttons when appropriate
I thought about Adam's comment over the weekend, and worked out a new version of the expressions that will allow for curves greater than 180 degrees. Now it doesn't matter what the curve looks like, the label will always describe it properly.
Steve
Please use the Accept as Solution or Kudo buttons when appropriate
jajaja, nice trick--> text height=1 if it is true and text height=0 if it is false. 🙂
Can't find what you're looking for? Ask the community or share your knowledge.