You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects General forum

Any Way to Programatically Move AnchorPoint...   Bob Goffena Mar 25, 2010
Re: Any Way to Programatically Move AnchorP...   Kirk Kuykendall Mar 25, 2010
Re: Any Way to Programatically Move AnchorP...   Bob Goffena Mar 25, 2010
Re: Any Way to Programatically Move AnchorP...   Kirk Kuykendall Mar 25, 2010
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Any Way to Programatically Move AnchorPoint of Callout? 
Author Bob Goffena 
Date Mar 25, 2010 
Message I need to programatically move the AnchorPoint of Balloon and Line Callouts. I have had no success in doing this, and haven't found any examples.

Is it possible to programatically move the AnchorPoint of a callout? If yes, how?

Thanks,

Bob 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Any Way to Programatically Move AnchorPoint of Callout? 
Author Kirk Kuykendall 
Date Mar 25, 2010 
Message see below

kkeywords move anchorpoint 
 
Option Explicit
Sub Test()
    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument
    
    Dim pGCS As IGraphicsContainerSelect
    Set pGCS = pMxDoc.PageLayout
    
    
    Dim pTElement As ITextElement
    Set pTElement = pGCS.SelectedElement(0)
    
    Dim pFTS As IFormattedTextSymbol
    Set pFTS = pTElement.Symbol
    If Not pFTS.Background Is Nothing Then
        If TypeOf pFTS.Background Is ICallout Then
            MoveAnchor pFTS.Background, 0, -0.5
            pTElement.Symbol = pFTS
            pMxDoc.ActiveView.Refresh
        End If
    End If
End Sub

Public Sub MoveAnchor(pCallout As ICallout, dx As Double, dy As Double)
    Dim pPoint As IPoint
    Set pPoint = pCallout.AnchorPoint
    pPoint.X = pPoint.X + dx
    pPoint.Y = pPoint.Y + dy
    pCallout.AnchorPoint = pPoint
End Sub
 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
http://www.ambergis.com
Now Answering questions at:
http://gis.stackexchange.com/


 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Any Way to Programatically Move AnchorPoint of Callout? 
Author Bob Goffena 
Date Mar 25, 2010 
Message I was missing the following line:
pTElement.Symbol = pFTS

I had mistakenly thought pTElement.Symbol was returning by reference, instead of by value. I will have to start paying closer attention to the documentation.

This has been helpful. Thanks,

Bob 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Any Way to Programatically Move AnchorPoint of Callout? 
Author Kirk Kuykendall 
Date Mar 25, 2010 
Message Yeah, this is a hard one to catch.

In VBA/VB6 you can use "is"
if pTElement.Symbol is pTElement.Symbol then
debug.print("return by reference")

(In C# you can use == )
 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
http://www.ambergis.com
Now Answering questions at:
http://gis.stackexchange.com/