How to cut geometric elements

Source: Internet
Author: User

How to cut geometric elements

 

Ifeatureedit example

'Assume pset (Iset) and pmovevector (iline) already exist.
Dim punknown as iunknown, pfeatureedit as ifeatureedit
Set punknown = pset. Next

Do While punknown is not nothing
Set pfeatureedit = punknown
Pfeatureedit. moveset pset, pmovevector
Set punknown = pset. Next
Loop

The following code is an example of one way you cocould split a selected polygon features by a polyline.

Public sub splitfeatures (pselectionset as iselectionset, ppolyline as ipolympus)

'Open a feature cursor on the selected features that
'Intersect the splitting geometry
Dim pfeatcursor as ifeaturecursor
Dim pspatialfilter as ispatialfilter
Set pspatialfilter = new spatialfilter
Set pspatialfilter. Geometry = ppolyline
Pselectionset. Search pspatialfilter, true, pfeatcursor

'Clean up the splitting geometry
'This is necessary because, for polygons, ifeatureedit: Split
'Relies internally on itopologicaloperator: Cut
Dim ptopoopo as itopologicaloperator
Set ptopoopo = ppolyline
Ptopoopo. Simplify

'Loop through the features and split them
Dim pfeature as ifeature
Set pfeature = pfeatcursor. nextfeature

Do until pfeature is nothing
Dim pfeatureedit as ifeatureedit
Set pfeatureedit = pfeature
Pfeatureedit. Split ppolyline
Set pfeature = pfeatcursor. nextfeature
Loop

End sub

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.