.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

length of CircularArc3d

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Anonymous
905 Views, 8 Replies

length of CircularArc3d

Does someone know how to get the length from CircularArc3d?

 

Thanks,

Frank

8 REPLIES 8
Message 2 of 9
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

is .GetLength the function you are searching for?

 

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 9
Anonymous
in reply to: Alfred.NESWADBA

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

Message 4 of 9
Alfred.NESWADBA
in reply to: Anonymous

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 5 of 9
Anonymous
in reply to: Alfred.NESWADBA

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

 

Message 6 of 9
Alfred.NESWADBA
in reply to: Anonymous

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 7 of 9
Anonymous
in reply to: Alfred.NESWADBA

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

Message 8 of 9
Alfred.NESWADBA
in reply to: Anonymous

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 9 of 9
Anonymous
in reply to: Alfred.NESWADBA

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost