Hi,
is .GetLength the function you are searching for?
- alfred -
Hi Alfred,
I did find the .GetLength function but have no clue how to use it. What kind of values do I have to use for fromParameter and toParameter.
Frank
Hi,
haven't tried it also, I think "parameter" will be used in the same way like for curves, parameter 0 means startpoint, the higher the parameter (up to EndParameter) the higher the distance on the curve. Look for the Curve-Parameters >>>here<<<
- alfred -
Hi Alfred,
Thanks very much for this sugestion.
Here is the solution
For i As Integer = 0 To myLwPolyline.NumberOfVertices - 1 Dim segType As SegmentType = myLwPolyline.GetSegmentType(i) If segType = SegmentType.Arc Then Dim myArc As Autodesk.AutoCAD.Geometry.CircularArc3d = myLwPolyline.GetArcSegmentAt(i) myLength = myArc.GetLength(myArc.GetParameterOf(myArc.StartPoint), myArc.GetParameterOf(myArc.EndPoint), 0) myRadius = myArc.Radius End If Next
Frank
Hi,
great that it helped you 😉
Let me take one line (part of line) out of your code:
myArc.GetParameterOf(myArc.EndPoint)
You use this statement to get the parameter at the endpoint of the arc, that's clear as long as the arc is not closed! If it's closed it returns 0 because of startpoint = endpoint! So be careful 😉
- alfred -
Ah, thanks for the warning.
I think there is no risk when the arcs are part of a polyline (like in my example). Am I correct?
Frank
Hi,
>> I think there is no risk when the arcs are part of a polyline
Don't know your drawings 😉 But yes, it seems to be not much risk, however I'm not used to work with probability in my applications 😉
One question to what you are doing: If you already have a AcDbPoly...objects, why do you convert it to AcGe-objects, because AcDbPoly...objects are derived from AcDbCurve and has similar functions/properties like the AcGe....
I don't know what you are working on, but if I already have a polyline I try to avoid to create an AcGe....object from it.
- alfred -
Hi,
You are right. To be sure I put in a check.
It's for calculating quantaties. I am a civil engineer designing roads. I use polylines for the curblines. In principle curblines are made out of straights and curves. I loop through the vertices of the polyline to find the curves. I use the function to obtain the lenght and radius of curves which tell me how many curb elements with a certain radius I need.
Thanks again for the help.
Frank