阅读:1129回复:0
有关ArcView中point移动的脚本有关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 请各位高手指点一下 在下看不太懂 不明白如何应用 谢谢了 |
|