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

有关ArcView中point移动的脚本

楼主#
更多 发布于:2005-04-01 11:37
<P>有关ArcView中point移动的脚本</P>
<P>'Moves and centers a graphic</P>
<P>
' 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</P>
<P>if ((strX.IsNumber) and (strY.IsNumber)) then  
  av.ShowMsg("Location:"++strX++strY)  
  x = strX.AsNumber
  y = strY.AsNumber  </P>
<P>
  ' Locate the graphic object that must be moved using the name...
  '
  grToMove = av.GetActiveDoc.GetGraphics.FindByName( strIdentifier )</P>
<P>  ' 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)</P>
<P>  grToMove.FindByName
  end</P>
<P>请各位高手指点一下 在下看不太懂 不明白如何应用 谢谢了</P>
喜欢0 评分0
游客

返回顶部