阅读:1805回复:4
请问:MO中如何用代码得到图层中一个对象的空间数据
<P>我现在用VB+MO做东西,想请教大家如何用代码得到图层中一个选定对象的空间坐标值,其实我是想得到一个polygon对象的各个顶点的x,y坐标值,可以实现吗?</P>
<P>请大家多多指教! 谢谢!</P> |
|
1楼#
发布于:2005-06-07 09:00
可以的,先得到Parts,再得到points
|
|
|
2楼#
发布于:2005-06-06 10:25
<img src="images/post/smile/dvbbs/em01.gif" />
|
|
3楼#
发布于:2005-04-22 11:21
自己回吧
<P>自己解决了,其实很简单,贴出来看一下:</P>
<P> List1.Clear Set oPoint = Map1.ToMapPoint(x, y) Set oMapRecords = Map1.Layers(0).Records Do While Not oMapRecords.EOF Set oShape = oMapRecords("shape").Value If oShape.IsPointIn(oPoint) Then Exit Do End If oMapRecords.MoveNext Loop</P> <P>For Each oPoints In oShape.Parts 'Parts is a collection of Points For Each oShapePoint In oPoints List1.AddItem Str(oShapePoint.x) ; "," ; Str(oShapePoint.y) ; " " Next oShapePoint Next oPoints</P> |
|
4楼#
发布于:2005-04-11 08:38
<P>不知道用MO是否可以实现这个功能?大家帮帮忙吧!</P>
<P>小妹在这多谢了!</P> |
|