エレメントの拡大

      2017/12/09

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 , ,