It's too late, the source of the direct connection:
<summary>//Tin Generate contour Line///</summary>//<param name= "Pinterval" > Contour Line Spacing < /param> public void Tin2contour (string path_,string name_,double pinterval) {//Get tin Itinlayer Ptinlayer = Getlayerbyname (Pscene, Combobox_tin. Text) as Itinlayer; ITin Ptin = Ptinlayer.dataset as ITin; Create contour shape iworkspacefactory PWSFAC = new Shapefileworkspacefactoryclass (); Ifeatureworkspace pfeaturews = pwsfac.openfromfile (path_, 0) as Ifeatureworkspace; if (System.IO.File.Exists (path_+ "\ \" +name_+ ". shp")) {System.IO.File.Delete (path_ + "\ \" + name_ + ". shp"); System.IO.File.Delete (path_ + "\" + name_ + ". dbf"); System.IO.File.Delete (path_ + "\" + name_ + ". Shx"); } ifields pfields = Createshapefields (esrigeometrytype.esrigeometrypolyline); Pfeaturews.createfeatureclass (Name_, pfields, NULL, NULL, Esrifeaturetype.esriftsimple, "Shape", null); Ifeatureclass Pcontourfeatureclass = Pfeaturews.openfeatureclass (name_); Generate contour line Itinsurface ptinsurface = Ptin as Itinsurface; Ptinsurface.contour (0, Pinterval, Pcontourfeatureclass, "Contour", 0); Add Contour layer Ifeaturelayer Pfeaturelayer = new Featurelayerclass (); Pfeaturelayer.featureclass = Pcontourfeatureclass; Igeofeaturelayer Pgeofeaturelayer = Pfeaturelayer as Igeofeaturelayer; Pgeofeaturelayer.displayannotation = true; Pgeofeaturelayer.displayfield = "Contour"; Pgeofeaturelayer.name = Pcontourfeatureclass.aliasname + "_contour"; Set Line style Ilinesymbol Plinesymbol = new Simplelinesymbolclass (); Plinesymbol.color = Getrgbcolor (32, 47, 247); Plinesymbol.width = 2; Isimplerenderer Prender = PgeofeatuRelayer.renderer as Isimplerenderer; Prender.symbol = Plinesymbol as Isymbol; Pscene.addlayer (Pfeaturelayer as ILayer); }
#region Create geometry fields///<summary>//Create Geometry fields///</summary>//<param name= "p _esrigeotype "></param>///<returns></returns> public ifields createshapefields (Esrigeo Metrytype p_esrigeotype) {ifields pfields = new Fieldsclass (); Ifieldsedit Pfieldsedit = Pfields as Ifieldsedit; Igeometrydef pgeodef = new Geometrydefclass (); Igeometrydefedit Pgeodefedit = pgeodef as Igeometrydefedit; pgeodefedit.geometrytype_2 = P_esrigeotype; pgeodefedit.spatialreference_2 = (ispatialreference) new Unknowncoordinatesystem (); Ifield pfld = new Fieldclass (); Ifieldedit Pfldedit = pfld as Ifieldedit; pfldedit.name_2 = "shape"; Pfldedit.isnullable_2 = false; pfldedit.type_2 = Esrifieldtype.esrifieldtypegeometry; Pfldedit.geometrydef_2 = Pgeodef; Pfieldsedit.addfield (PFLD); return pfields; #endregion #region Get layer by name//by name get layer public ILayer getlayerbyname (Iscene scene, St Ring strlayername) {ILayer pLayer = null; for (int i = 0;i < scene. layercount;i++) {PLayer = Scene.get_layer (i); if (Strlayername = = Player.name) {break; }} return PLayer; } #endregion
The Contour feature description reference Help documentation.
Copyright notice: This article Bo Master original articles, blogs, without consent, may not be reproduced.
Arcengine the contour generated by the next tin