MapInfo Pro

 View Only

MapInfo Monday: Convert texts annotations of CAD files into MapInfo Table Database

  • 1.  MapInfo Monday: Convert texts annotations of CAD files into MapInfo Table Database

    Posted 07-17-2023 07:38
    Edited by Peter Møller 07-17-2023 09:39

    Happy #MapInfoMonday!

    Today I want to explain you how we can convert and store Text information in CAD files into MapInfo Database.

    First of all we need to convert a cad file from Universal Translator in MapInfo to convert DWG/DXF/DGN files or Import from a DXF file.

    Thanks to Peter Møller for this opportunity.

    Here we see an example DWG conversion.

    Below we have some Slope, Distance, Building name, Electric Cable information. As you see there is no database info in the browser.

    Let's first add a new column to store the info, and select the text objects into a query and Update with the text value ( here some of the texts are in Dimension Layer)

    From Table – Maintenance, add a new column let's say Text_info and size as Character(254):

    From Simple Select: type STR$(OBJ) = "TEXT" in the that Satisfy: section and name the query as text_objects

    Then Update the text_objects query with OBJECTINFO( OBJ, 3) (i.e. the text info of text objects)

    Here is the result. As you se the  distance and slope texts and values are seperate objects.

    Update BUILDING Polygon NAMES

    From Table – Update Column menu choose the Building layer to be updated, and choose Text_objects to get value from, and the results will be like this.  

    JOIN condition should be "Objects from text_objects are Within the Buildings.

    Choose 

    Below is a sample result:

    Update LINES : Pipe Slope and Distance 

    The text info of pipes do not intersects with pipes. So we will use buffer,

    First we need to give a unique ID to each pipe, and open Distance and Slope columns.

    Then we need to Update pipe ID's with ROWID from the Update Column menu

    Now we can create buffer for each pipes from Spatial – Buffer section

    Measure the distance between text and pipes with Rules, And type the value in Radius Value,

    Then choose One Buffer for each object:

    And we have the buffers:

    Now we need to separate Slope and Distances into different Queries.

    Distance info have " m" and the end , and Slope has % sing.

    For slope we will use Instr operator, since % is a wildcard in SQL and selects all.

    For distance text , we will use like operator

    Now we can Update the Slope and Distance into Buffer table and then transfer into Pipe table.

    NOTE:

    Some records are updated and some not, we can change the buffer width and Update again. We need to check if there are more than one slope or distance text around a pipe.

    ELECTRIC, TELECOM ETC

    We can find the electric or fiber related texts and either transfer the info to a related object or convert them to Points, so we can have Elect Transformers, or Fiber ODF's

    We can also select object by color and Green/Red/Blue assign their info

    For Line and polygon Objects we can use Objectinfo(obj,2) and Objectinfo(obj,3) to get the color info

    Or alternatively and easily you can select from Map – Select – Select by Style menu

    After selecting similar object, we can Update the query with relevant information.

    Hope you can find useful and valuable information from my post.



    ------------------------------
    Ahmet Dabanli
    Başarsoft
    Balgat, Cankaya
    ------------------------------