默认头像
wyb
路人甲
路人甲
  • 注册日期2005-03-13
  • 发帖数27
  • QQ
  • 铜币215枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1129回复:0

有关ArcView中point移动的脚本

楼主#
更多 发布于:2005-04-01 11:37

有关ArcView中point移动的脚本

'Moves and centers a graphic

' Parsing is expecting a string with the 3 pieces of information needed, ' if information is passed as a list, then change appropriately... ' strX = SELF.Extract(0)           ' the x coordinate to move to strY = SELF.Extract(1)           ' the y coordinate to move to strIdentifier = SELF.Extract(2)  ' the unique name of the graphic object

if ((strX.IsNumber) and (strY.IsNumber)) then     av.ShowMsg("Location:"++strX++strY)     x = strX.AsNumber   y = strY.AsNumber  

  ' Locate the graphic object that must be moved using the name...   '   grToMove = av.GetActiveDoc.GetGraphics.FindByName( strIdentifier )

 ' The graphic should be centered on the new point...   '   ptGraphicExtent = grToMove.GetExtent   xOffset = ptGraphicExtent.GetX / 2   yOffset = ptGraphicExtent.GetY / 2   pt = grToMove.GetOrigin   pt.SetX(x - xOffset)   pt.SetY(y - yOffset)      ' Invalidate and move graphic object...   '   grToMove.FindByName   grToMove.SetOrigin(pt)

 grToMove.FindByName   end

请各位高手指点一下 在下看不太懂 不明白如何应用 谢谢了

喜欢0 评分0
默认头像

返回顶部