[ORD VBA] Automate Toggle of "Use Active Feature" Feature Definition Toolbar button

Hi,

I'm trying to automate the pre-filling of the "Set Feature Definition" dialog in VBA and can get it to work if I select the Feature Definition in the Feature Definition toolbar and select the "Use Active Feature" function of the Toolbar.

The issue I'm having is that even if I preset the "Use Active Feature" setting as enabled in the Preference Civil settings or enable it via a keyin, it doesn't actually activate the command (just toggles the button). It seems that it physically needs to be activated by the user.

Has any one found a way to get the "Use Active Feature" command to activate without physically activating the Toolbar button?

Regards,

Mark

Parents Reply Children
  • Thanks Andy, much appreciated.

    Essentially im trying to use the following VBA code to automate setting Feature Definitions for imported Geometry (mainly GENIO). It reads an excel spreadsheet that details Linear Feature Name prefixes and a corresponding Feature Definition to map. It then scans the model and sets Feature Definition for elements using the (crude) method below.

    It has been working fine, but has always needed the user to physically click the Active Feature Override button on the Feature Definition toolbar as the first line of code didn't work as expected (hopefully fixed now):

     

    CadInputQueue.SendKeyin "GEOMETRY ACTIVEFEATUREOVERRIDE TRUE"

    CadInputQueue.SendKeyin "GEOMETRY FEATUREDEFINITION SET"

    CadInputQueue.SendKeyin "CIVILCMD SETVALUE FeatureType=<FeatureType>6,False</FeatureType>"

    CadInputQueue.SendCommand "GEOMETRY SETACTIVEFEATURE " + oFeatDefName

    CadInputQueue.SendDataPoint oPoint, oView

     

    Ideally we could streamline this whole process to not even need to use the Feature Definition toolbar if the following recorded VBA could be used in new VBA macros (it currently does nothing)

      

    CadInputQueue.SendKeyin "CIVILCMD SETVALUE FeatureDefinition=<FeatureDefinition>Bentley.CifNET.GeometryModel.ContentManagement.LinearObjectSettings, Bentley.CifNET.GeometryModel.4.0, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4bf6c96a266e58d4|Linear\Earthworks\D-EWKS-Back of Drain|False</FeatureDefinition> "

      

    Regards,

    Mark


    OpenRoads Designer 2022 R3 (10.12)  |  Microstation 2023.1  |  ProjectWise CE 3.4