Raster Manager API native use

Don't really know how to ask ...

Handling Raster Refs per MicroStation API, using native "ustation.dll" code for running functions outside V8i there seem to be limitations. While being able to detach rasterrefs, trying to attach rasterrefs our development partner fails.

Are there any undocumented functions, parameters that can be used? Is there a separate API for raster ref functionality? Any help or hints?

Bigean

  • When working with Raster References in MicroStation you need to use the function families mdlRaster and mdlCntr.  These are both well documented in the MDL Function Reference help file.

    HTH,

    mark anderson [Bentley]

  • Hi Bigean.

    If you want to attach a raster you should use mdlRaster_fileOpen followed by mdlRaster_attach.

    If you have done already some code which is not working, can you post it so I can take a look at it.

    Thanks,

    Mathieu

     

     

     



  • Mark:
    mdlRaster and mdlCntr are both well documented in the MDL Function Reference help file.

    They may be well documented, but they are not well explained. What is the relationship between a raster attachment and a cntr (presumably an abbreviation of container)? Why do rasters need a cntr when vector attachments do not?

    Mathieu:
    If you want to attach a raster you should use mdlRaster_fileOpen followed by mdlRaster_attach.

    That usefully answers the question "How does one attach a raster?" The only examples I have found are for iterating and detaching rasters.

    But, where does mdlCntr enter into raster attachments? Why, when iterating rasters, do we need a cntr but not when attaching one?

    And what is the mdlCntrExt API? How does a CntrExt differ from a cntr?

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Coming back to the initial question, it's native code outside MicroStation that fails to attach, while (AFAIK) it runs fine inside an open MicroStation session. I know you can't always expect to have all functionality running outside Microstation. It's pretty clear that any state or display related behaviour requires an active MicroStation session.

    Just since conventional DGN references can be handled native/outside, we thought we have a chance for rasterrefs as well.

    Bigean

  • Bigean:
    Using native "ustation.dll" code for running functions outside V8i there seem to be limitations. It's native code outside MicroStation that fails to attach, while (AFAIK) it runs fine inside an open MicroStation session.

    Perhaps you'd better clarify what you mean or understand by running functions outside V8i. If you are building an application using C++ with the Microsoft tools that build a DLL, your code is running 'inside' MicroStation. So what exactly is your native code outside MicroStation?

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Jon,

    I'm really not sure if a C++ Exe using ustation.dll has identical environment. Code can't access open views. Can't detect states/events. While none of this should affect raster reference attachment, still we see it working as .ma, but no go as .exe. That's what it looks like in the moment. I'm not the programmer so forgive me if I'm totally wrong ;)

    Anyway, if it's something simple to solve (if it's no problem to attach rasterrefs from an .exe), I'll be happy to know about it. Just even knowing it could work would motivate us to proceed with trying. I don't necessarily need examples or code analysis.

    Bigean

  • Bigean:
    I'm really not sure if a C++ Exe using ustation.dll has identical environment.

    It most definitely has not. Most of the MDL API is intended only for use by in-process applications (i.e. implemented in a DLL or .ma file).

    There are very few MicroStation DLLs that a separate process (i.e. an .exe application) can call safely. I'm surprised that you've progressed as far as you have.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Considering that the ustation.dll is not designed to be used outside of MicroStation I am not surprised that you cannot call the RasterAPI.  You should check the restrictions on using the library.  If you have a question on this contact BDN and we can discuss this offline. 

    Rgds,

    Mark Anderson [Bentley]

  • Ok, so the result is: no chance.

    Not that I'm surprised or angry. It's just the limits. Thanks anyway :)

    Bigean

  • Jon Summers:
    Mark:
    mdlRaster and mdlCntr are both well documented in the MDL Function Reference help file.

    They may be well documented, but they are not well explained. What is the relationship between a raster attachment and a cntr (presumably an abbreviation of container)? Why do rasters need a cntr when vector attachments do not?

    Mathieu:
    If you want to attach a raster you should use mdlRaster_fileOpen followed by mdlRaster_attach.

    That usefully answers the question "How does one attach a raster?" The only examples I have found are for iterating and detaching rasters.

    But, where does mdlCntr enter into raster attachments? Why, when iterating rasters, do we need a cntr but not when attaching one?

    And what is the mdlCntrExt API? How does a CntrExt differ from a cntr?

    Regards, Jon Summers
    LA Solutions

    Hi John,

    This topic shows how to use mdlRaster to attach a raster  http://communities.bentley.com/products/microstation/microstation_v8_xm_edition/microstation_v8_xm_edition_programming/f/158/t/36433.aspx

    mdlCntr is essentially a list or a map, the Ext version is for debugging. It informs developpers if they forgot to release the Cntr.

    hth

    Simon