Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
MicroStation
  • Product Communities
MicroStation
[Archived] AskInga Wiki Element remapping 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
        • Alternate method to change element attributes
        • Change non-snappable elements to snappable in V7
        • Change non-snappable elements to snappable in V8 2004 Edition
        • Change non-snappable elements to snappable in V8 XM Edition
        • Customize quick info dialog
        • Display element ranges
        • Drag and drop into attributes tool box to match attributes
        • Drill into your file with Element Manager
        • Element direction
        • Element height
        • Element information by ID number
        • Element quick info
        • Element remapping macro
        • Extended element info settings
        • Keyin to lock the active element template
        • Match element attributes using the ALT key
        • Match stuff under your cursor in V8.5
        • Matching hatch symbology
        • Open the attribute tool box items under your cursor
        • Place an element to mask the graphics underneath
        • Set symbology of new elements
        • Smartline Join Elements keyin
        • The old element information dialog
        • Toggle fill display and active fill type with this VBA
        • Transparent shapes in MicroStation V8
        • Watch those associative patterns
      • +Element Selection
      • +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. 

    Element remapping macro

    AskInga logo

    Original Article Date: March 27, 2006 

    With thanks to Robert McCartney for contributing this VBA macro that will help you to remap your elements from one set of attributes to another. It's a nice alternative to MicroStation's remapping utility.
    2006-05-30 Application updated.
    2006-06-07 Application updated.

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

    This macro creates and applies element remapping patterns to migrate data from one set of symbology attributes to another. The remapping patterns are loaded and saved to XML records for storage and viewing via a web browser. Once loaded you'll notice four distinct tabs:

    1. Active Remapping Attributes
    2. Remap Pattern List
    3. Element Remapping
    4. Element Attributes

    Active Remapping Attributes
    The data in this tab is used to build the remapping patterns. The content displayed in the Active Element Attributes section on the left side is populated by the ReScan Attriubtes button on the fourth tab. You then select which elements to remap and select your output (destination) attributes.

    In a nutshell...
    1. Load the element attributes via the fourth tab.
    2. Define an element attribute filter
    3. Define the target element attribute - This is a pattern.
    4. Save or load a pattern from the second tab
    5. Remap the element attributes by selection set, selected models or design file.

    For example:

    In the image below you can see that all elements in my test file were drawn in colour 0, style 0, and on the default level. The only significant variation are the two different weights.

    In order remap the block lines to the proper level and change thier symbologys, I've selected the line strings on the default level that are drawn in colour 0, weight 1 and style 0. In the Intended Element Attributes section, I've selected the desired output actions which is to move them to the level called Block Line and change the symbology to ByLevel.

    Select the Save Active Remap Pattern to save this information and write it to the second tab called Remap Pattern List. The lower portion of this tab allows you to write the patterns to an external XML file that will be written to the root of your C:/ drive.

    Process the data by navigating the the third tab titled Element Remapping. Note that there is an undo button provided or you can use Edit > Undo from MicroStation.

    Choosing Select Single Element or Selection Set will be determined by the Remapping Option chosen. If the Apply Selected Remap Pattern option is chosen for use with Select Single Element or Selection Set then only the first pattern from the list will be tested.

    Multiple remap patterns can only be used when doing a file Scan/Remap or Model Scan/Remap.

    So if you set the Remapping Option to Filter with Active Attributes then only the current dialog attributes will be scanned/remapped. If you choose Apply Selected Remap Pattern then all the selected remap patterns will be tested and the remap attributes applied if they pass...Depending the absolute/relative mode of course....

    When remapping there are two modes:

    Absolute - An element must pass the entire attribute filter criteria before it can remapped. i.e: The element must match the selected level, type, colour, weight, style attributes in order to be remapped.

    Relative - Any element attribute which matches the selected filter attribute, and has a target attribute selected, will be remapped. ie: If the element colour matches the filter then it will be remapped to the new attribute if selected.

    This program was developed on MicroStation 08.05.01.25 and is NOT guaranteed to work on all versions of MicroStation. Please test this software on a copy of your drawing until you are comfortable working with it. Thank you.

    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 #295

    • Askinga
    • Element Properties
    • FreewareShareware
    • Article
    • Share
    • History
    • More
    • Cancel
    • Hannah Blye Created by Hannah Blye
    • When: Tue, May 27 2008 4:25 PM
    • Jordan Stierly Last revision by Jordan Stierly
    • When: Thu, Jun 10 2010 3:11 PM
    • Revisions: 5
    • 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