Check For Existence of View Group using VBA

Hello MicroStation Programming Community,

How would one check for the existence of a View Group within the active Design File using VBA code? I can't seem to find examples of this. Looking to delete the View Group if it exists.

Thanks!

Parents Reply
  • Strangely enough, after changing the oViewGroup Declaration to Dim oViewGroup As ViewGroup, the applicable View Group can now be deleted. I originally had the oViewGroup Declaration set to Dim oViewGroup As MicroStationDGN.ViewGroup.

    It should be noted that after making the above oViewGroup Declaration change, a Bentley Exception Error was generated upon running the module (reproduceable). However, your code includes the Exit For line, which my code did not. Adding this resolved the Bentley Exception Error issue.

    Thank you so much for your help!

    ProjectWise Explorer CONNECT Edition, Version 10.00.03.453

    ProjectWise Drive, Version 2022.1.328

    OpenRoads Designer CONNECT Edition, Version 10.09.00.91

    OpenRoads Designer CE 202 Release 2, Version 10.10.21.4

    Power GEOPAK V8i (SELECTseries 10), Version 08.11.09.918

Children