エレメントの拡大

投稿日:2016/9/1 (木) 更新日:

Public Sub ScaleElement()
    Dim pMxDocument As IMxDocument
    Set pMxDocument = ThisDocument
     
    Dim pGraphicsContainerSelect As IGraphicsContainerSelect
    Set pGraphicsContainerSelect = pMxDocument.PageLayout
     
    Dim pElement As IElement
    Set pElement = pGraphicsContainerSelect.SelectedElement(0)
     
    Dim pGeometry As IGeometry
    Set pGeometry = pElement.Geometry
     
    Dim pTransform2D As esriGeometry.ITransform2D
    Set pTransform2D = pGeometry
     
    Dim pArea As IArea
    Set pArea = pGeometry
     
    Dim pPoint As IPoint
    Set pPoint = pArea.Centroid
     
    With pTransform2D
        .Scale pPoint, 2, 1
    End With
     
    pElement.Geometry = pGeometry
     
    pMxDocument.ActiveView.Refresh
     
End Sub

関連記事

-プログラミング, ArcGIS
-, ,

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.