Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4331

[CONNECT C#] ElementGraphicsProcessor - ProcessTextString() is never called

$
0
0

Hi, I've been trying to run ElementGraphicsProcessor on text elements and no matter what I try the ProcessTextString() method is never called. Code sample bellow. Running it on a model with a single text element or text node element I get only:

  1. AnnounceIdentityTransform()
  2. AnnounceElementMatSymbology()
  3. AnnounceIdentityTransform()

What should I do to get the ProcessTextString() called?

[OpenCities Map PowerView CONNECT Edition - Verze 10.13.00.48 Windows x64]

DgnModel dgnModel = Session.Instance.GetActiveDgnModel();
ModelElementsCollection allElemsCol = dgnModel.GetElements();
foreach(Element element in allElemsCol)
{
    MyProcessor myProcessor = new MyProcessor();
    ElementGraphicsOutput.Process(element, myProcessor);
}

public class MyProcessor : ElementGraphicsProcessor
{
    public override void AnnounceElementDisplayParameters(ElementDisplayParameters displayParams)
    {
        ShowMessage("AnnounceElementDisplayParameters()");
    }

    public override void AnnounceElementMatSymbology(ElementMatSymbology matSymb)
    {
        ShowMessage("AnnounceElementMatSymbology()");
    }

    public override void AnnounceIdentityTransform()
    {
        ShowMessage("AnnounceIdentityTransform()");
    }

    public override void AnnounceTransform(DTransform3d trans)
    {
        ShowMessage("AnnounceTransform()");
    }

    public override bool ExpandLineStyles()
    {
        ShowMessage("ExpandLineStyles()");
        return true;
    }

    public override bool ExpandPatterns()
    {
        ShowMessage("ExpandPatterns()");
        return true;
    }

    public override FacetOptions GetFacetOptions()
    {
        ShowMessage("GetFacetOptions()");
        return null;
    }

    public override bool ProcessAsBody(bool isCurved)
    {
        ShowMessage("ProcessAsBody()");
        return true;
    }

    public override bool ProcessAsFacets(bool isPolyface)
    {
        ShowMessage("ProcessAsFacets()");
        return true;
    }

    public override BentleyStatus ProcessBody(SolidKernelEntity entity)
    {
        ShowMessage("ProcessBody()");
        return BentleyStatus.Error;
    }

    public override BentleyStatus ProcessCurvePrimitive(CurvePrimitive curve, bool isClosed, bool isFilled)
    {
        ShowMessage("ProcessCurvePrimitive()");
        return BentleyStatus.Error;
    }

    public override BentleyStatus ProcessCurveVector(CurveVector curves, bool isFilled)
    {
        ShowMessage("ProcessCurveVector()");
        return BentleyStatus.Error;
    }

    public override BentleyStatus ProcessFacets(PolyfaceHeader meshData, bool filled)
    {
        ShowMessage("ProcessFacets()");
        return BentleyStatus.Error;
    }

    public override BentleyStatus ProcessSolidPrimitive(SolidPrimitive primitive)
    {
        ShowMessage("ProcessSolidPrimitive()");
        return BentleyStatus.Error;
    }

    public override BentleyStatus ProcessSurface(MSBsplineSurface surface)
    {
        ShowMessage("ProcessSurface()");
        return BentleyStatus.Error;
    }

    public override BentleyStatus ProcessTextString(TextString text, double zDepth)
    {
        ShowMessage("ProcessTextString()");
        return BentleyStatus.Error;
    }

    public override bool WantClipping()
    {
        ShowMessage("WantClipping()");
        return false;
    }

    public void ShowMessage(string brief, string detailed = null, OutputMessagePriority priority = OutputMessagePriority.Debug)
    {
        NotifyMessageDetails messageDetails = new NotifyMessageDetails(
            priority, brief, detailed, NotifyTextAttributes.None, OutputMessageAlert.None);
        NotificationManager.OutputMessage(messageDetails);
    }
}

Viewing all articles
Browse latest Browse all 4331