Database linkages

Hi i am trying to link graphical elements to the database using odbc connection.

Everything works fine in terms of text, but i need the level or colour of a specific element to go accross to the database and should change dynamically if i change a colour or level in the design.

Is this possible or not?

If so please explain

I am running microstation select series 2 on my pc

Parents
  • Hi,

    from technical point of view I think it is possible to develop such solution, but in MDL/C++ and not in VBA. You have to track all changes that will be written to a design file and to write selected events into your database. My feeling is such solution will be fragile and possibly slow.

    Can you describe what you want to achieve as your request is a bit unusual? May be another solution or workflow exists already.

    With regards,

     Jan

  • What I am trying to achieve is to have 4 different colours as circles for example in the design file. That must be written to a database and can be changed dynamically. Do you have any example files of writing levels or element colours to the database?

  • No, I have no such example. As I wrote, it is a bit unusual request.

    In general it is not recommended to store any information in two places - in your case the color will be stored as an element property in DGN and a database. You can track if the element color will change in DGN (a user will change it and the change will be saved) and you can subsequently change the information in the database. But what will happen if the database will be not connected. And what if the color information will be changed in the database directly? In such case you have no chance to replicate such change back into DGN.

    BTW What you wrote is what you want to achive from technical point of view. But what is the value and reason of such functionality? It sounds similar to GIS approach when features (elements) are stored completely in the database and they are extracted to DGN and if changed, posted back to the database.

    [Added] If you want to learn more about how to hook design file changes, I recommend to check MDL and C++ API documentation.

     Jan

  • We want to use that functionallity to check whether certain elements in a mine shaft are correct or not.

    You say that its similar to the GIS approach. What do you mean by that and how do i go about using it because it does not matter what application i use, as long as it opens a dgn file?

  • If it is about checking element, have you tried Standard Checker? It can be easily extended with VBA or MDL and also can be used in batch mode, so it is can be utilized to check more files in the same time.

    I have to say I see no connection between checking element and a dynamic linkage to a database. Can you describe step-by-step how you want to check your designs? Usually it is done per-file and there is plenty of options based on what condition the elements are checked. Do you use Element templates?

     Jan

  • I think i confused you abit. I meant that the users will place the different graphic element colours(circle) on the design file where they see a problem. this should be written to a database. If there are any changes in the element colour it should change on the database as well. Is it easier to this via the GIS way that you mentioned?If so how do i go about doing it?

  • OK, now it is clear and much more simple :-)

    I will try to repeat howyour application should look like:

    • There will be a special tool to place "marks" where a use will see a problem.
    • When the mark will be placed, a record should be created in the database.
    • There will be a special tool that will allow to change the color of the mark. If the event "color changed" appears, the database record should change. If you will allow to change the color only with your tool and not MicroStation tool, you can skip out from hooking DGN element change, which will make your application simplier.
    • The connection graphics > database is "one way", so the graphics change is replicated to the database, but not in the opposite direction (from database to the design file).

    Something like this can be simple or pretty complex and sophisticated application. In the simple form it can be developed in VBA in MicroStation, PowerDraft (or may be even in Bentley Navigator, but not quite sure about that :-).

    There are plent of questions and issues crossing my mind related to such application, probably the most important is how to establish the connection between the particular circle mark and the database. You can use MicroStation DB linkage or you can design your system and to establish your connection, both have pros and cons. WIll be there more "marked design" connected to the database or only one design file will server as basic map for marking?

    HTH Jan

Reply
  • OK, now it is clear and much more simple :-)

    I will try to repeat howyour application should look like:

    • There will be a special tool to place "marks" where a use will see a problem.
    • When the mark will be placed, a record should be created in the database.
    • There will be a special tool that will allow to change the color of the mark. If the event "color changed" appears, the database record should change. If you will allow to change the color only with your tool and not MicroStation tool, you can skip out from hooking DGN element change, which will make your application simplier.
    • The connection graphics > database is "one way", so the graphics change is replicated to the database, but not in the opposite direction (from database to the design file).

    Something like this can be simple or pretty complex and sophisticated application. In the simple form it can be developed in VBA in MicroStation, PowerDraft (or may be even in Bentley Navigator, but not quite sure about that :-).

    There are plent of questions and issues crossing my mind related to such application, probably the most important is how to establish the connection between the particular circle mark and the database. You can use MicroStation DB linkage or you can design your system and to establish your connection, both have pros and cons. WIll be there more "marked design" connected to the database or only one design file will server as basic map for marking?

    HTH Jan

Children