# How-to: Get edge length

**URL:** <https://forum.techsoft3d.com/t/how-to-get-edge-length/1446>\
**Category:** HOOPS Exchange\
**Tags:** code, learn, knowledge-base, how-to, brep\
**Created:** [November 18, 2020, 5:00am UTC](https://forum.techsoft3d.com/t/how-to-get-edge-length/1446 "2020-11-18T05:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel.peragine](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/gabriel.peragine/32/1535_2.png) [@gabriel.peragine](https://forum.techsoft3d.com/u/gabriel.peragine)\
**Post date:** [November 18, 2020, 5:00am UTC](https://forum.techsoft3d.com/t/how-to-get-edge-length/1446/1 "2020-11-18T05:00:00Z")

</div>

Get length of a edge using `A3DCurveLength` which computes the length of a curve with interval of edge

[![](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/4bb3b246448a4e65cf7f17797315504047e45b10.png)A3DSDKAdvancedTools.h — HOOPS Exchange 2023 documentation](https://docs.techsoft3d.com/exchange/latest/api/A3DSDKAdvancedTools_8h.html?highlight=a3dcurvelength#_CPPv414A3DCurveLengthPK10A3DCrvBasePK15A3DIntervalDataP9A3DDouble)

```auto
A3DTopoEdgeData sData;
A3D_INITIALIZE_DATA(A3DTopoEdgeData, sData);
A3DTopoEdgeGet(pEdge, &sData);
const A3DCrvBase* p3DCurve = nullptr;
if (sData.m_p3dCurve != nullptr)
		p3DCurve = sData.m_p3dCurve;
else
{  
	const A3DEntity* pBrep; // A3DRiBrepModel
	A3DRiBrepModelData sRiBrepData;
	A3D_INITIALIZE_DATA(A3DRiBrepModelData, sRiBrepData);
	A3DRiBrepModelGet(pBrep, &sRiBrepData);
	A3DTopoEdgeGetOrCompute3DCurve(sRiBrepData.m_pBrepData, pEdge, &p3DCurve);
}
if (p3DCurve)
{
	double curveLength = 0.0;
	A3DCurveLength(p3DCurve, sData.m_bHasTrimDomain ? &sData.m_sInterval : NULL, &curveLength);
    // Apply A3DTopoContextData::m_dScale, scale of representation item and product occurence
    doubel edgelength = curveLength * scale;
}					

```
