Hi,
I try to place annotation feature to exist features by VBA but only one feature in annotated.
This is my code:
Dim oLocateOp As New locateOp Dim oFeatureEnum As FeatureEnumerator Dim oFeature As feature Dim oAnnotation As feature Dim oInputPoint As inputPoint Dim oInputValue As InputValue Dim oTextParams As TextParams Dim oPointOp As New PlacePointOp xft.CmdMgr.SetProperty "placementGroup", "placement" oLocateOp.IncludeOnlyFeatures = True oLocateOp.IncludeFeatureName ("BUDELEC_E_STREETLIGHTPOLE") oLocateOp.Mode = LocateOpMode.locateOpModeScan oLocateOp.AutoAcceptScanFile = True oLocateOp.Execute Set oFeatureEnum = oLocateOp.GetLocatedFeatures Do While oFeatureEnum.MoveNext Set oFeature = oFeatureEnum.Current oFeature.Group = "placement" Set oAnnotation = New feature oAnnotation.name = "BUDELEC_E_STREETLIGHTPOLETEXT1" oAnnotation.Alias = "BUDELEC_E_STREETLIGHTPOLETEXT1" oAnnotation.Group = "placement" oAnnotation.GeometryType = GEOMETRYTYPE_Text oFeature.Write False oFeature.AddSubFeature oAnnotation oAnnotation.InitializeProperties "placing" Set oInputPoint = New inputPoint oInputPoint.SetElementBasedType PointType_Origin, oFeature oInputPoint.UseOriginalElementLocation = True Set oInputValue = New InputValue oInputValue.SetTypeAndValue ValueType_VALUE, "2.0" oInputPoint.AddOffset pointOffsetType_Y, oInputValue Set oTextParams = New TextParams oTextParams.SetOrigin oInputPoint oAnnotation.SetTextParams oTextParams oPointOp.AddFeatureToGenerate oAnnotation
Loop xft.CmdMgr.StartPlacePointOperation oPointOp, New clsPlaceTextEvent
Private Sub IPlacementEvents_OnFinished() placementGroup = xft.CmdMgr.GetProperty("placementGroup") xft.FeatureMgr.WriteFeaturesByGroup placementGroup, False xft.FeatureMgr.SavePreferencePropertiesByGroup placementGroup, "placing" xft.CmdMgr.RestartCurrentCommand End Sub
Before I accept command I see all annotations but when OnFinished() is called only one feature is annotated.
How to annotate all features?
Thanks.