datablock vs. tags

Hi group,

I am in the process of designing a tool that needs to store information "on" elements in a dgn. Various strings and doubles to connect the elements to data from various databases and such.

I have succeeded in using datablock to do this, but maybe tags would be a better way?

I have successfully added tags to an alignment DGNfile using inRoads, and can now see various extended information in a new group: "Horizontal Alignment" in the microstation element inspector information window. I like that! I like it a lot actually! But I am a bit confused.. So my question goes:

Can I add tags to elements so they aren't visible, but show up in the element inspector AND are avaiable through VBA?

If so, any hints as to how they are added to the elements, and also how they are retreived would be greatly appreciated. Or if you have any thoughts about using datablock over tags or vice-versa I would like to know why.

Thanks,
/Torben (of to read the manual...=)

Parents
  • Update, and partial answer to my question:

    I see that I can access the tags using the "Review Tags" tool.
    I think that would mean they are "regular" tags, and whatever data I choose to add to an element, I can add in the same way. But,

    Can I have multiple of these tag types (groups in the element inspector with various data attached)?

    The help file seems to have some information to maybe get me going on adding/retrieveing tags through VBA.

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.

  • Tag Set Definitions

    Unknown said:
    Can I have multiple of these tag types (groups in the element inspector with various data attached)?

    It's not entirely clear what you are asking.

    A DGN file can contain more than one tag set definition. You can attach more than one tag set to an element.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Hi Thorben,

    What you see in "Horizontal Alignment" are not tags, Jon and I talking about. This is a InRoads enhancement to microstation and  the dgn elements. These application data from InRoads are not tags its "user data-linkages:

    Use a vanilla Microsation and you can't see the "Horizontal Alignment" with element info. Try to use the old element info tool " analyse element" to see this "data linkages". But to understand tha linkages and to mimic them . You must ask the InRoads Development.

    User data from a "InRoads DTM Trianlge" Shape

    BTW: Have you checked the RDBMS interface from microsation where you may attach database linkages to dgn elements and work with them.

    It's the second way microstation may work with non graphical data.

    Regards

    Frank

    since 1985: GIS, CAD, Engineering (Civil)  Senior Consultant : [Autodesk Civil 3D , Esri ArcGIS, VertiGIS: in previous days : Bentley MS V4 - V8i, GeoGraphics, Bentley Map V8i, InRoads,  HHK Geograf, IBr DAVID] :  Dev: [C, C++, .NET, Java, SQL, FORTRAN, UML]
    [direct quote by: http://en.wikipedia.org/wiki/Helmut_Schmidt]: "Wer Kritik übel nimmt, hat etwas zu verbergen"
    Wer Grammatik- und/oder Rechtschreibfehler findet, der darf sie behalten :-)

  • Thanks Frank.

    Then the data from inRoads must be stored twice as I can also clearly see the same information when I use the tag tools. I personally don't condone having the same data stored twice, and simply assumed the Bentley team would also not store the same data twice. Thus I concluded that what I saw in the "element info" was actually the tag data! Ah well, Live and learn I guess :)

    I thought I had a vanilla install of v8i (SS3 some older beta version but still) as I don't have any inroads tools available, but I guess there must be some libraries hidden somewhere then.

    My conclusion is that I see no reason for switching from using datablock to tags.

    Regards,

    /Torben

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.

  • The additional InRoads information in the datablock is only exposed when InRoads is running and even then, often you need the proper ALG or DTM file loaded.

    What is written in tags is available always - unless no tags are attached.

    In reality, the data is still there only once. What is written in the datablock is just the information InRoads need to connect the graphics to its data as stored in the aforementioned files. As for the data missing from the tags, it would be necessary to add your own tags or some other user data to hold the missing information to allow more feedback.

    Even the new Civil Geometry tools require one of the Civil Products to do what they do.


    Charles (Chuck) Rheault
    CADD Manager

    MDOT State Highway Administration

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996
  • Hi Thorben,

    Something I found today: Maybe it can help you:

    communities.bentley.com/.../188105.aspx

    Regards

    Frank

    since 1985: GIS, CAD, Engineering (Civil)  Senior Consultant : [Autodesk Civil 3D , Esri ArcGIS, VertiGIS: in previous days : Bentley MS V4 - V8i, GeoGraphics, Bentley Map V8i, InRoads,  HHK Geograf, IBr DAVID] :  Dev: [C, C++, .NET, Java, SQL, FORTRAN, UML]
    [direct quote by: http://en.wikipedia.org/wiki/Helmut_Schmidt]: "Wer Kritik übel nimmt, hat etwas zu verbergen"
    Wer Grammatik- und/oder Rechtschreibfehler findet, der darf sie behalten :-)

  • Hi Frank et all,

    I have never had any problems getting the tags from the elements generated by inRoads!

    My "problem" is; I'd like to use tags IF the data will then be shown in the "Element inspector". But it doesn't automatically show. Some kind of Bentley-weirdo-o-magic routine is making the inRoads tag data show, but not the one I add to my elements. So, unless someone from Bentley steps up with some code, it's gonna be datablocks from here on out..  (on this project)

    :)

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.

  • Torben,

    I am thoroughly confused as to what data you are adding and what you expect to see in the Element Information tool.  There has been discussion of Tags, XAttributes, and User Data Linkages (I am guessing this is what you imply by datablock).  All of these are methods for adding non graphic information to elements.  Here is my review of the pros and cons.

    Tags: public accessible data that you can experiment with through the tools in MicroStation before committing to programming.  You need to have a Tag Definition in the file then add tags to each element that needs to hold the information.

    XAttributes: MDL (C++ ) only data. You request an ID from Bentley and store your information related to an element.

    We will report that there is information but not what is in the information.

    User Data: MDL and VBA.  You request an ID from Bentley and then you store your data on the element.  You (the developer) are the only one that knows the data format.  For Element Information we will just report the hex view of the bits.  

    Now what you are seeing in Element Information are some special handled data that we do not have a public api for at this time.  To learn more about this data I would suggest that you review i-models and the business data that can be attached to the graphics.

    Hope this clarifies the ways non graphic data can be held in DGN files.  If you need more clarification feel free to contact me.

    Rgds,

  • Thanks Mark,

    If you are confused, then no wonder I am by all this terminology! ;)

    But to clarify (or add to the confusion):

    I am reading tag elements from a DGN generated by inRoads.
    This DGN also displays the same - or a copy of -  the data available in the tags in the element inspector. Probably using this special not public API thingy you mention. I wondered if I could display MY data the same way - but I understand that I cannot.

    I am storing "userdata" elements, that really is just a big lump of data, a "datablock" (thats what its called in the help files) on elements. together with this "ID from Bentley". I am using the "AddUserAttributeData" funkction together with a made up ID, and the datablock.

    (We only use my program inhouse, and I name my datablocks so I can clearly identify them, and also I need to use more than one datablock per element. But I promise to at some point get a few of these IDs! I can clearly understand why - especially when I begin to dominate the entire world ;)

    Thanks,
    /Torben

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.

  • What you see in the Element Information dialog box is only a pointer to be used by InRoads so it knows that this data was created by InRoads and if the matching data is loaded, that it can read the InRoads Data, saved in InRoads, and put it into the popup tooltip. It is not simply reading the userdata and translating it into human terms. It needs the data stored in InRoads to be used.

    The Tag information is actually more data than is in the datablock/userdata. To put the tag data to use, it is necessary to combine it with the geometry of the graphic elements and even then, as you have found, it is not 100% of the information stored in InRoads. (No Station or equation information, for example.)

    To get all of the InRoads data, you need InRoads running as well and then would need to use the InRoads API that is available in VBA. I always found the surface (DTM) tag data more useful than the alignment tag information.

    The only other alternative, is LandXML. At MD SHA -part of Maryland DOT, they have some tools that allow you to load a LandXML file and use the data in a similar manner to how it might be used in InRoads.

    One reason that it was developed was because InRoads versions kept changing and custom tools that interfaced with it kept needing to be updated and even recompiled - which usually required a budget item to pay for the developer to do and could take months and even years to accomplish.

    By creating a VBA program that read a Land XML file, they freed themselves from this issue. New version of InRoads - no problem, since you needed a new Land XML file whenever you used the tool to ensure the data was current.


    Charles (Chuck) Rheault
    CADD Manager

    MDOT State Highway Administration

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996
  • Mmmmm.. XML FTW!! :D

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.

  • XML - a grammar for general-purpose data

    LandXml - a dialect of XML designed for survey and other related design data

     
    Regards, Jon Summers
    LA Solutions

Reply Children
  • Woa... I just dicovered that with AddUserAttributeData the datablock  is appended to a list of attribute data, not replaced!

    I had the impression that there was only ONE datablock with a certain ID attached/saved with ONE element. Seems there is a whole bloody array of them saved to each element!?!

    Omg...

    Is there an in depth article discussing the use of the userAttributeData?

    what I do right now, to work around this "issue", is read all data, delete completely, and rewrite.
    i would like a neat way of replacing. Something like: write userdata to datablock(0). How would the code look for something like that?

    I like the feature of the userdata array, I just wish I'd been smart enough to extract that infromation from the - ahem - manual.

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.