Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
OpenCities Map
  • Product Communities
  • Geospatial
  • OpenCities Map
  • Cancel
OpenCities Map
OpenCities Map Wiki - XFM attribute query (Feature Query VBA)
    • Sign In
    • -OpenCities Map Wiki
      • -OpenCities Map
        • - End of Support for Bentley Map V8i (SELECTseries) products
        • +Release Information
        • +Installation Information
        • +Getting Started
        • +Administration
        • +General Topics
        • +Geospatial Administrator
        • +Feature Definitions and Inference Rules
        • +Interoperability
        • +Spatial Databases
        • +Spatial Analysis
        • +3D Geospatial
        • +Geographic Coordinate Systems
        • +Troubleshooting
        • -Freeware - Utilities - Applications - Programs
          • - Auto update Editing initial values (Sync1 MDL)
          • - Centroid text to shape (VBA)
          • - Change feature elevation (VBA)
          • - Convert text to XFM and propagate text string to shapes using VBA
          • - Create schema from Shapefiles (Schema Register EXE)
          • - Export text string and Element ID (TextNodeToTextFile VBA)
          • - Extended Properties (xProps MDL)
          • - Label latitude and longitudes (VBA)
          • - Learning Resources
          • - Load properties from text strings (text2xfm VBA)
          • - Planarize 3D Polygon (MDL)
          • - Show XFM Properties on tool tips (MDL)
          • - Symbology Integrator (EXE)
          • - Utilities from Elivagner Barros
          • - XFM attribute query (Feature Query VBA)
          • Setting Level for reference attachment (VBA)
        • +Advanced Map Finishing
      • OpenCities Map Ultimate for Finland CONNECT Edition x64 (SES)
      • OpenCities Map Ultimate for Finland CONNECT Edition - Suomi
      • Bentley Descartes
      • +Other Geospatial Products

     
     Questions about this article, topic, or product? Click here. 

    - XFM attribute query (Feature Query VBA)

    This macro is for V8i only.

    ---

    The attached macro provides an alternate method of searching and locating XFM features.  This simple yet customizable search option may be a good alternative to using the generic and complex capabilities offered by Bentley Map's Query tool.

     FeatureQuery.zip

    Installation:

    1. Download and place the MVBA in the folder pointed to by MS_VBASEARCHDIRECTORIES.
    2. Add the following line to the CFG file of the XFM workspace to load the VBA at startup:  MS_VBAUTOLOADPROJECTS > xfmFeatureQuery
    3. The Feature Query tool looks for query files in the MS_GEOWSHOME\qry folder.  Create qry folders for each XFM workspace using this tool.

     

    Configuration:


    The Feature Query tool uses customizable query files (*.QRY) to define searches and may include such items as the feature table to use, the attribute name, the title of the search and so on.  A template is provided showing the supported parameters.


     


    A sample design file and queries are provided.   The design file contains parcels, addresses and communications data for a few city blocks.


     

     

      

    The following example performs a query on a single property:


     

    The following example queries two properties from the same table.  In this case, the street name and house number:


     

     Usage:

    When the Feature Query tool is configured for the active workspace of a Bentley Map or Bentley Map based tool (OpenUtilities, Bentley Comms, etc), it can be started with the following key in:  vba execute [xfmFeatureQuery] OpenDialog

    This keyin can be added to a custom button or a function key for quick access.

    When started, the Feature Query dialog will open and list the available queries found in MS_GEOWSHOME\qry  folder.  


    If the macro does not find a location with query files, it will abort with an error message and not open the dialog.

    Select one of the available query options.  In single property mode, the Feature Query dialog changes to show a second property list containing the available property values and a de-activated search button.


     

    In dual property mode, the dialog shows a second property list containing the available property values as well as a de-activated third option list and search button.


     

    Note that you can switch from one search query to the next.

    Select the property or properties to search.

    In single property mode, the selected property will activate the Search button.

    In dual property mode, the first selection will activate the next option list.  A selection in the next option list will then activate the search button.


     

    Click the Search button to execute the search.  When a single feature is found, the Feature Query tool will select and zoom to the feature in the active view.


     

    When multiple features are found, the Feature Query tool will load the results into the Data Browser for further exploration.


     

    Note that the Feature Query tool is modeless which allows you to keep the dialog open and execute multiple queries during your design session.

     

    Localization:

    You have the option to specify language specific titles and label parameters in the query files.

    The Feature Query tool checks the operating system for the language defined in the regional settings.  Based on that setting, it will try to load a string in the appropriate language.  Currently, English (=default) and German strings are included.

     

    Limitations:

    The Feature Query tool has the following known limitations.

    1. Only XFM data residing in the open file or attached reference files are supported. 
    2. Database (spatial) queries are not supported
    3. This tool can be slow when working with a large dataset or reference files.
    4. A combo box can only hold 65,535 items.  If the list contains more than this, it will be truncated

     

    Disclaimer - This application is supplied as-is and does not come with support. Bentley Systems Inc., and the author of this programs assume no liability for damages direct, indirect, or consequential, which may result from the use of this program. Use this application at your own risk.


    • XFM
    • VBA
    • Macro
    • Share
    • History
    • More
    • Cancel
    • Inga Morozoff Created by Bentley Colleague Inga Morozoff
    • When: Mon, Aug 10 2015 11:30 AM
    • Inga Morozoff Last revision by Bentley Colleague Inga Morozoff
    • When: Thu, Nov 22 2018 4:27 PM
    • Revisions: 19
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies