Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
MicroStation
  • Product Communities
MicroStation
[Archived] AskInga Wiki Select by fill colour using this macro
    • Sign In

    • -AskInga
      • +3D MicroStation
      • +AccuDraw Secrets
      • +Animation - Rendering
      • +Behind The Scenes
      • +Cells
      • +Colours
      • +Conversion - Translation
      • +Coordinate Input
      • +Design Settings
      • +Dimensions
      • +DWG
      • +EDG
      • +Element Manipulation
      • +Element Properties
      • -Element Selection
        • Can't select elements or manipulate selection sets?
        • Change how the PowerSelector starts
        • Choose inverse
        • Choosing previous selection set
        • Choosing the last element
        • Create a selection set from your graphic group
        • Create a selection set with crossing mode
        • Create fence from flood
        • Disable highlighting when passing cursor over elements
        • Element info dialog - organize by modes
        • Element selection missing from reset Pop-Up menu
        • Faster way to select all elements
        • How to deselect - clear - release a selection set
        • How to quickly locate erroneous elements
        • Make a new selection set
        • Named fences
        • Named groups, displaysets and quick sets
        • Option to enable AccuSnap for fence placement
        • PowerSelector nifty CTRL click trick
        • Remove elements from from the view display without using levels
        • Select all elements on the active level
        • Select by fill colour using this macro
        • Show element vertices with this macro
        • Slow response when creating and working with selection sets
        • Using a fence to create a selection set
        • Using AccuSnap when placing a fence
        • Using TAB to cycle through elements
      • +Freeware - Shareware
      • +Interface Look And Feel
      • +Internet - E-Links - Links
      • +Keyins
      • +Levels
      • +Line Styles
      • +Models
      • +MSM Archive
      • +Other
      • +Presentations
      • +Printing - Plotting
      • +Programming - Automation
      • +Rasters - Images
      • +References
      • +Tags - Data Fields - Fields
      • +Text - Fonts - Annotation
      • +Views
      • +Windows - Interacting With
      • +Workspaces - Configuration
    • graffiti

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

    Select by fill colour using this macro

    AskInga logo

    Original Article Date: May 2006 

    Updated:  July 2011

    Look what you can do if you learn a little about VBA! This little application will scan the design file and select all shapes based on a user specified fill colour. Now, how cool is that? Thanks Rudi!

     

    Download 296.zip and extract FindFill.mvba from the file.
    Place the mvba in the folder pointed to by MS_VBASEARCHDIRECTORIES
    Keyin vba load findfill to load the project, or...
    Configure MS_VBAAUTOLOADPROJECTS to automatically load the mvba project upon startup.
    Keyin vba run [findfill]main to run the macro, or...
    Place the keyin on a function key or custom button for quick and easy access.

    This macro is a great little example to learn different aspects of VBA. For example:

    - Scanning for elements and refining the criteria.
    - Creating a selection set from the results.
    - Creating a user form and linking buttons to the code.
    - Error handling and creating message boxes for each error/warning as shown below.

    This program is supplied as is. AskInga, Bentley Systems Inc., and the author of the program assumes no liability for damages direct, indirect, or consequential, which may result from the use of this program. Use this program at your own risk.

    AskInga Article #296

    • Element Selection
    • Askinga
    • Colours
    • FreewareShareware
    • Article
    • Share
    • History
    • More
    • Cancel
    • Hannah Blye Created by Hannah Blye
    • When: Tue, May 27 2008 4:21 PM
    • Inga Morozoff Last revision by Bentley Colleague Inga Morozoff
    • When: Thu, Jul 21 2011 9:43 AM
    • Revisions: 9
    • 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