[V8i C# Addin] FloodFill Method

I'm wanting to obtain area measurements just like the flood MeasureArea command in Microstation. However, I want the user to obtain these measurements through my addin rather than that tool. I want to use the exact same function that MeasureArea --> Flood uses in microstation but I'll be modifying the data obtained for my user and that's why I need the addin.

I've not yet found a C# method for addins for obtaining a measureArea --> flood measurement once the user has clicked a coordinate in the DGN file. Does a method exist?

Parents Reply
  • Unknown said:
    Is one of the references above including that?

    Yes, it is bentley.interop.microstationdgn

    Unknown said:
    Can anyone point me to the function in C# for GetFloodBoundary?

    Probably now I understand what confuses you.

    MVBA hides usage of Application class and usage of MicroStationDGN namespace, so you can use its functions directly. In .NET there is no any default object, so you must explicitly use a MicroStationDGN.Application interface instace.

    To obtain an instance of MicroStationDGN.Application interface you need assembly bentley.microstation. There is a class Bentley.MicroStation.InteropServices.Utilities, which has a property ComApp.

    Use it as follows:


    using BIM = Bentley.Interop.MicroStationDGN;
    ...
    BIM.Application ustn = Bentley.MicroStation.InteropServices.Utilities.ComApp;
    BIM.Element floodBoundary = ustn.GetFloodBoundary(...);

    HTH

    Answer Verified By: zCane75 

Children