阅读:1461回复:0
如何创建一个注记层Shp文件
<P>用AO下用编程的方法将CAD 文件(dwg或dxf)转化成5个shp文件,其它的几个层都没有问题,关键是注记层,转换后的Shp文件是点层,而不是注记层,在ArcMap下显示是一个个的点,而不是标注,虽然点的位置和源文件的注记层的点位置一致。请问怎么生成一个标准的注记层Shp文件啊。下面是部分代码</P>
<P>pNewFeatCls 是Shp文件对应的featureclass</P> <P>pFeatCls是从CAD文件中得到的注记层featureclass这个没有问题,请大侠指点,谢谢了</P> <P>pNewFeatCls = pFeatWs.CreateFeatureClass(sShpDir, pFields, Nothing, Nothing, _<BR> esriFeatureType.esriFTCoverageAnnotation, "shape", "")<BR> Dim pCursor As IFeatureCursor<BR> pCursor = pFeatCls.Search(Nothing, False)<BR> Dim pFeat As IFeature<BR> pFeat = pCursor.NextFeature()<BR> Dim pNewFeat As IFeature<BR> While Not pFeat Is Nothing<BR> pNewFeat = pNewFeatCls.CreateFeature()<BR> pNewFeat.Shape = pFeat.Shape<BR> For i = 1 To pFeat.Fields.FieldCount - 1<BR> If pFeat.Fields.Field(i).Name <> pFeatCls.ShapeFieldName Then<BR> pNewFeat.Value(i) = pFeat.Value(i)<BR> End If<BR> Next<BR> pNewFeat.Store()<BR> pFeat = pCursor.NextFeature()<BR> End While</P> |
|