laptop and a wrench

漏洞

IRelationResult.RelationElement property does not work in VBA - returns "Invalid use of property" compile error.

上次发布: August 19, 2020 ArcGIS for Desktop
漏洞 ID 编号 NIM056080
已提交April 6, 2010
上次修改时间June 5, 2024
适用范围ArcGIS for Desktop
找到的版本9.3.1
编程语言VBA
操作系统Windows OS
操作系统版本XP
状态Will Not Be Addressed

附加信息

We apologize that we were unable to address this issue within the current product support cycle.  If the issue continues to affect your work in a supported release, please contact Technical Support.

解决办法

Use C# code: public void OnClick() { try { IWorkspaceFactory wsFact = new FileGDBWorkspaceFactoryClass(); IFeatureWorkspace featWS = (IFeatureWorkspace)wsFact.OpenFromFile(@"<a href="file:C:/incidents/792309/Test.gdb" target="_blank">C:\incidents\792309\Test.gdb</a>", 0); IFeatureClass featClsPoly = featWS.OpenFeatureClass("Polygon"); IFeatureClass featClsLine = featWS.OpenFeatureClass("Polyline"); object obj = Type.Missing; IGeometryCollection geomCollGon = new GeometryBagClass() as IGeometryCollection; IFeatureCursor featCur = featClsPoly.Search(null, false); IFeature feat = featCur.NextFeature(); while (feat != null) { geomCollGon.AddGeometry(feat.ShapeCopy, ref obj, ref obj); feat = featCur.NextFeature(); } IGeometryCollection geomCollLine = new GeometryBagClass() as IGeometryCollection; featCur = featClsLine.Search(null, false); feat = featCur.NextFeature(); while (feat != null) { geomCollLine.AddGeometry(feat.ShapeCopy, ref obj, ref obj); feat = featCur.NextFeature(); } IRelationalOperatorNxM relOpNxM = geomCollGon as IRelationalOperatorNxM; IRelationResult relRes = relOpNxM.Crosses(geomCollLine as IGeometryBag); int count = relRes.RelationElementCount; int left, right; for (int i = 0; i < count; i++) { relRes.RelationElement(i, out left, out right); IGeometry geomGon = geomCollGon.get_Geometry(left); IGeometry geomLine = geomCollLine.get_Geometry(right); } } catch (Exception e) { MessageBox.Show(e.Message); } }

重现步骤

漏洞 ID: NIM056080

软件:

  • ArcGIS for Desktop

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项