xfm Element with 2 different Annotations

In the GSA I have defined a cell with 2 annotations. To place these 2 annotations, I have adapted the sub "PlacePolygonAndAnnotation" from the example/demo vba. As a result the 2 annotations are placed on the cell, so placed with the same origin. However, I want to offset the annotations so that one label is displayed above the cell and one below. However, I can't find the right place in the code where I can define this.

This is my code:

Dim oCellOp As New xft.PlacePointOp
Dim promptText As String

' --- initialize operation specific properties ---
xft.PropMgr.InitializeOperationProperties "BERG", "placing"

' --- set up common properties to be used throughout current command ---
xft.CmdMgr.SetProperty "placementFeature", "Berg"
xft.CmdMgr.SetProperty "placementAlias", "Berg"
xft.CmdMgr.SetProperty "featureOps", featureOps
xft.CmdMgr.SetProperty "toolSettingsName", toolSettingsName
xft.CmdMgr.SetProperty "placementGroup", "placement"

' --- set the current command name ---
xft.CmdMgr.CommandPrompt = cmdPrompt

' --- First the root cell feature ---
Dim oCell As New xft.feature
oCell.Name = "Berg"
oCell.Alias = "Berg"
oCell.Group = "placement"
oCell.GeometryType = GEOMETRYTYPE_Cell

oCell.InitializeProperties "placing"

' --- Second the annotation sub-feature ---
Dim oAnnotation As New xft.feature
oAnnotation.Name = "BergText"
oAnnotation.Alias = "BergText"
oAnnotation.Group = "annotation"
oAnnotation.GeometryType = GEOMETRYTYPE_Text

' Add Annotation to root feature before Annotation initializing properties
oCell.AddSubFeature oAnnotation

oAnnotation.InitializeProperties "placing"

Dim oAnnotationOrigin As New xft.InputPoint
oAnnotationOrigin.SetElementBasedType PointType_Range_CC, oCell

Dim oAnnotationTextParams As New xft.TextParams
oAnnotationTextParams.SetOrigin oAnnotationOrigin

oAnnotation.SetTextParams oAnnotationTextParams

'--------------------------------------------------------------
' --- Third the annotation2 sub-feature ---
Dim oAnnotation2 As New xft.feature
oAnnotation2.Name = "BergZahl"
oAnnotation2.Alias = "BergZahl"
oAnnotation2.Group = "annotation"
oAnnotation2.GeometryType = GEOMETRYTYPE_Text

' Add Annotation to root feature before Annotation initializing properties
oCell.AddSubFeature oAnnotation2

oAnnotation2.InitializeProperties "placing"

Dim oAnnotationOrigin2 As New xft.InputPoint
oAnnotationOrigin2.SetElementBasedType PointType_Origin, oCell

Dim oAnnotationTextParams2 As New xft.TextParams
oAnnotationTextParams2.SetOrigin oAnnotationOrigin

oAnnotation2.SetTextParams oAnnotationTextParams2

' --- set up the placement operation ---
promptText = GetPromptText(leaderFeatureAlias, "MSGKEY_PointOrigin", DefaultPrompt_POINT_Origin)
oCellOp.SetDataPointPrompt pointOpPromptTypeOriginPoint, promptText

oCellOp.SetToolSettingsByOpAndName featureOps, toolSettingsName
oCellOp.AddFeatureToGenerate oCell

oCellOp.AddFeatureToGenerate oAnnotation
oCellOp.AddFeatureToGenerate oAnnotation2

' --- start the placement ---
xft.CmdMgr.StartPlacePointOperation oCellOp, New clsPlacePointOp

I am grateful for any tip. 

Alex

I am working with OpenCities Map Advanced Connect Edition Update 7
Version 10.07.01.09

Parents Reply
  • I asked our Development team what can be done and they offered this:

    User would need to sequentially start a PlacePoint operation for each annotation to place individually by cursor.   So in the IPlacementEvents_OnFinished for the cell placement, they could start the first annotation placement operation.  See sub PlaceAnnotation in xfmStdOpsLib project module Library for example annotation placement.  In the IPlacementEvents_OnFinished for the first annotation placement, they could start the second annotation placement operation. In the IPlacementEvents_OnFinished for the second annotation placement, write the root feature for the cell which would also write the two annotation sub-features.



Children
No Data