Quantcast
Channel: OpenCities Map Wiki
Viewing all articles
Browse latest Browse all 1284

- Convert plain text to XFM and propagate text string to polygons

$
0
0
Revision 1 posted to Bentley Map - Wiki by Inga Morozoff on 5/1/2018 6:27:15 PM

This tutorial discusses converting plain MicroStation text to usable XFM features and propagate the text string value to polygons.  This is accomplished by using two lightweight macros that are attached to this article.  

First of all, a Bentley Map project schema is created that includes two features:  MapTile as a polygon and MapTileText as a point-text feature.  Each has a text string property named Label  which will be the placeholder for the text string.

The design file is a grid of map tiles that are labelled accordingly.   The map tiles and labels are on separate levels named:  MapTiles and MapTileText. 

When the design file is opened with the Map project as the active workspace, the MicroStation elements are identified as inferred features.

Load the provided VBA named text2xfm and run the macro ModMain.run.  The Input Feature/Level will be the existing text in the design file, and the Load Property will be a text property of the feature definition.  In order for this macro to work as intended, ensure that the level of the text matches the level of the text feature in the project schema.  When processed, the text will change to green and be recognized as XFM native features. 

As well, when Analyze Feature or Edit Feature is used, the dialogs show that the original text string is now a business property of the text feature.

The next step in this workflow is to propagate the label from the newly created text features to the existing map tile shapes.  To do that, the map tiles must first be promoted to XFM features using the Bentley Map Promote tool that's part of the map schema.  When promoted, the shapes will change colour to red.  Note that the Label property is left blank at this time.

Load the second macro named centroids_text_to_shape.mvba  (it will load as centroid3 in the VBA Project Manager).    This macro requires that the text features are centroids in closed shapes.  This means that they need to be completely within the boundaries of the shapes in order for the macro to be successful.  The dialog of the macro enables you to select the polygon and centroid (text) features as well as the property to copy.  Clicking Copy Business Properties will execute the macro and in this example 15 centroids are processed.

Reviewing a map tile shows that the Label property is now populated with the text value of the centroid.

The attached zip file contains the geospatial project, the design file and both macros. 

Disclaimer:

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


Viewing all articles
Browse latest Browse all 1284

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>