Select to view content in your preferred language

GeometryEngine.Instance.Offset

230
3
Jump to solution
3 weeks ago
Living2Learn
Emerging Contributor

ArcGIS Pro 3.3
ArcGIS Pro SDK 3.3.0.52636

I use this in various tools and all are failing when applying a negative value to the offset distance.
The error for the left side is "GeometryException: An internal error has occurred in the geometry system."

double righttest = 25;
double lefttest = -25;


// This works
Polyline right = GeometryEngine.Instance.Offset(existgeom, righttest, OffsetType.Round, 0) as Polyline;

// This fails when using a negative value
Polyline left = GeometryEngine.Instance.Offset(existgeom, lefttest, OffsetType.Round, 0.5) as Polyline;

Worked at 3.2 with out issue.

0 Kudos
1 Solution

Accepted Solutions
Living2Learn
Emerging Contributor

For anyone that comes across this here is solution.

double righttest = 25;
double lefttest = -25;


// This works
Polyline right = GeometryEngine.Instance.Offset(existgeom, righttest, OffsetType.Round, 0) as Polyline;

// This works when using a negative value
Polyline left = GeometryEngine.Instance.Offset(existgeom, lefttest, OffsetType.Miter, 0.5) as Polyline;

Hopefully, it will not change with the next version.

View solution in original post

0 Kudos
3 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

I see you use bevelRatio parameter not equal 0 (0.5). That parameter is used only when offsetType is miter. Your offsetType is round. Try reset bevelRatio. Maybe it is a side effect?

0 Kudos
Living2Learn
Emerging Contributor

Thanks for your response.

I originally had the bevelratio set to 0. Just confirmed by setting back to 0. Still getting the same error. Checked using multiple polylines. Some with curves some with just lines. It only happens on negative distance values.

 

0 Kudos
Living2Learn
Emerging Contributor

For anyone that comes across this here is solution.

double righttest = 25;
double lefttest = -25;


// This works
Polyline right = GeometryEngine.Instance.Offset(existgeom, righttest, OffsetType.Round, 0) as Polyline;

// This works when using a negative value
Polyline left = GeometryEngine.Instance.Offset(existgeom, lefttest, OffsetType.Miter, 0.5) as Polyline;

Hopefully, it will not change with the next version.

0 Kudos