How to convert IGeometry to IPolyline

407
2
Jump to solution
06-26-2012 08:52 PM
InsuHong1
New Contributor
Hi,

I'm trying to convert IGeometry object to IPolyline. Specifically, IGeometry, that is polygon, and convert its boundary to IPolyline object.

I tried

   IPolyline plObject = (IPolyline)IGeometryobject;

but it was failed.



How can I do that?



Thanks.


Insu
0 Kudos
1 Solution

Accepted Solutions
NeilClemmons
Regular Contributor III
You can't cast a polygon to a polyline because they aren't the same thing.  You need to extract the polygon boundary.  You can do this via ITopologicalOperator.Boundary.

View solution in original post

0 Kudos
2 Replies
NeilClemmons
Regular Contributor III
You can't cast a polygon to a polyline because they aren't the same thing.  You need to extract the polygon boundary.  You can do this via ITopologicalOperator.Boundary.

View solution in original post

0 Kudos
InsuHong1
New Contributor
Thanks. It works!!

Thank you. It's great help for me.
0 Kudos