Is there a reason why element.Range would be different depending on which way you open the design file in code? Is there some sort of "Recalibrate" or "Resize" method that I need to execute before getting the Range data? It appears that the OpenDesignFileForProgram is the wrong value.
Thanks.
Viktor_Kulik said:OpenDesignFile vs OpenDesignFileForProgram
Prefer to use OpenDesignFile.
OpenDesignFile
OpenDesignFileForProgram is a wrapper around the mdlWorkDgn_api. When you open a DGN file using that method none of the usual resources (e.g. DGNLibs) are available.
OpenDesignFileForProgram
mdlWorkDgn_api
Viktor_Kulik said:Accessing range of Element via Interop
You haven't told us which programming language you're using, or the version of MicroStation. If using MicroStation CONNECT, there's a first-class .NET API: you don't need to use an InterOp.
Regards, Jon Summers LA Solutions
For this purpose OpenDeisgnFile is not an option, this is mainly for a test between the NET and Interop API, performance vs ease of access. Scanning 500 files and extracting text data at all levels and models is actually very comparable to the NET api (performance wise), I thought NET would be quicker to be honest.
First class though? maybe if the documentation would be better.
Jon Summers said:If using MicroStation CONNECT, there's a first-class .NET API
Viktor_Kulik said:First class though?
MicroStation CONNECT can use .NET as a primary API. In V8, C# was a second-class API. You had to use either an InterOp (to use VBA) or P/Invoke (to use MDL).
Viktor_Kulik said:Maybe if the documentation would be better
Jan and I have made countless comments about the terse nature of the MicroStationAPI and the .NET API help documentation. The .NET documentation is split between five different files, often making it hard to find the right help topic for a given class.
Viktor_Kulik said:I thought NET would be quicker to be honest.
It depends, but generally it is (because there are less layers), but the difference is minor, especially in methods, called once.
First class API is only C++ ;-)
But, NET API beats Interop in 99% in terms of flexibility, features and OOP design. The remaining 1% are situations, when particular functionality is available in Interop, but not in NET API (like cell placement from cell library).
Viktor_Kulik said:maybe if the documentation would be better.
That's true, but from the time I use MicroStation API C++ help for everything, and check relevant NET assemblies internal directly, I do not care too much about NET documentation.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
I'm still not on friend terms with c++ help files, but it seems like i need to get over that... Would love to get your thoughts/help on the TextNode question i posted a few mins ago.