Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: Raster File Validation in C# Connect Update 4 and SDK 4

$
0
0

Hi Olcay,

[quote user="Olcay EBCIN"]Raster ras in RasterManager.Rasters gives error.[/quote]

Is that seriously "developer's answer"? What error? What is reported? Is it runtime exception or an issue is reported by Visual Studio during code editing?

[quote user="Olcay EBCIN"]And I would expect code like this:

foreach(Raster ras in RasterManager.Rasters)

{

.... some code

}

Unfortunately this code doesnt work in C#[/quote]

This code is incomplete and it simply cannot run. What is RasterManager? Is is RasterManager addin from Bentley.RasterManager.dll assembly? Or is it Raster Manager interface? Or RasterManager from Interop (but in such case it cannot be used in this way)?

[quote user="Olcay EBCIN"]Does anybody know how to do it?[/quote]

This is an extraction of the code that works fine. Definitions including namespaces used intentionally to make clear what classes are used.

// COM Application reference in Run() method
s_com = Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp;

// An iteration through attached rasters
Bentley.Interop.MicroStationDGN.RasterManager rm = s_com.RasterManager;

foreach(Bentley.Interop.MicroStationDGN.Raster raster in rm.Rasters)
{
    // Process attached rasters here
}

With regards,

  Jan


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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