阅读:1122回复:0
有关ArcView中point移动的脚本
<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> |
|