Hi,
where I can find a guide for using Microstaion .NET API? I hope there is a file similar to MDLAPIFunctionReference
Thanks
Best Regards
Giuseppe
I would start by joining the Bentley Developer Network community and getting the AddIn Wizard and workshop that are posted to that group. Next I would study the COM object model as that is the easiest api that can be used in the .NET environment. The next thing that I would suggest is looking at Microsoft documentation on Mixed Mode C++ as this will sooner or later be something that your project will involve. The deliivered example CellUtility does a nice job of showing how to progress from simple AddIn to complex AddIn with event handling and calls to the MDL api.
Ciao,
Mark Anderson [Bentley]
mark anderson [Bentley]
Visit me at https://communities.bentley.com/communities/other_communities/bentley_innovation/default.aspx
Mark:
Have there been any white papers on the basics of developing C# Programs for MicroStation? Are we talking about setting it up to generate an ma file somehow? The Development cycle in C# and the Programming environment aside...it there a "roadmap"? The CellUtility is a fine example...but once it "compiles"...what the heck do ya do with it!?
haha!...clearly, I'm missing something...
Sometime back I did a blog posting on Developing with the Visual Studio Wizards. In the BDNWizard zip file there is a workshop presentation that I did on getting started with .NET and MicroStation development. I would take a look at that (over in the Bentley Developer Section) and see if that gets you pointed correctly. After that there are probably more advanced tips and tricks that you can get from this forum.
HTH,
sounds like a "plan"...Thank You, Mark! , I'll go see if I can find that,
- Bob
Very Slick!
I managed to get the examples running between the notes from your class and the powerpoint . I haven't messed with the wizard yet, but that has been getting good press, so I'm not worried (famous last words! :) )
To offer something to this thread...I am ~ 3 Months into C# and the best books I have found are Jesse Liberty's titles (O'reilly & assoc.) and Charles Petzold's ".NET Zero" freebie off of his web site (www.charlespetzold.com/.../index.html) - hard to beat that price too.
anyway, I have a couple of questions...
Is the addin the "way of the future" for MicroStation Development...and how does C# fit into the future for this type of programming?
Also, If I am looking to build a program that as a secondary function, needs to open a designfile and return all the attached reference files, is this the right programming platform? The bulk of the program would be independent of microstation...there may only be need for a single class to read info out of a design file...or several design files...
Thanks!
Bob
Bob: the best books I have found are Jesse Liberty's titles (O'reilly & assoc.)
The Albahari brothers write good C# prose: notably C# in a Nutshell.
And give LINQPad a trial.
Regards, Jon Summers LA Solutions
Unknown said:Is the addin the "way of the future" for MicroStation Development...and how does C# fit into the future for this type of programming?
In a word...No. C# is, without a doubt, an extremely powerful and pleasant tool to work with. I use it and I love it. Nevertheless, the notion that Bentley is about to exchange the inescapable benefits of C++ for some supposed benefit in C# is not realistic. For applications that just need to augment the functionality of MicroStation and/or some extension, an addin can be the most cost effective approach. For applications that need to access the full exposed power of MicroStation and its daughter products, the only real choice is C++ native code.
Regarding your app, if you're thinking to automate MicroStation, just bear in mind that doing so is still a pretty tricky maneuver. I think you can probably do all you want to do from an external C# application but you'll still want to check out Mark Anderson's SessionInfo example. It's in a CPP file but you should be able to extract the pertinent API calls. Maybe Mark will see this and post a zip. If not, I'll try to remember to check back and attach it if you like. Irrespective of my comment above, applications that have limited interaction with MicroStation's API's may be particularly good candidates for flexing your C# muscles.
Regards,
Charles Griffith
All Good info..and I will check out the LinQPad .
I haven't messed with LinQ yet, just using the XML data functionality..at least so far.
Albahari brothers - yes, I have read samples of their books...but I haven't seen all of them yet...I'll check it out.
We went C# on this application because we wanted to play by the organization's "rules" - they are trying to standardize on .NET... The app sets up a job with appropriate files from appropriate seed files..directories..etc. ..I can just see this moving from "creating" files to doing tweaks to the files...like filling in title blocks, placing monuments...etc., etc...
If I need heavy lifting, I can figure out a way to use C++ for that, I'm sure..(again, "famous last words!").
I just wanted to make sure I was headed in the right direction...and how log until I hit a brick wall :-)
From the other posts, I was getting the feeling that C# development was ...possible.....but there is a lot of Marshalling to do. But, by the time I get done with interfacing with Projectwise....it may "just be the way I think"...hah!
anyway, "SURE" to the example code!...That always helps!
much thanks, guys!
In other words, C# is very good for UI, but not as good for functionality, C++ is very good for functionality, but not as good for UI. So the best bet is to make two DLLs. One is native with all functionality and second one is .NET Assembly with only UI and Addin class. Then all you need is invoking exported native methods from this UI, so your UI is powerful .NET window and functionality is as fast as possible. Mixed DLLs are not as fast as native code, so if your goal is performance, go away from /clr option in C++ project...
HTH
Dan
in regard to the LinQPad....cool.
a "snippet" tester....
of course now I have to learn how to use the "Snippets Manager"...!doh!
-not that I don't need to anyway....
in response to DanPaul...
Right now, I am in an interactive application...the milliseconds don't bother me because most of the performance is being "soaked up" in the user "experience"...so I'm not splitting hairs....so long as it doesn't take 45 seconds to open a dgn file :- )
That is an interesting idea...layering a C++ program between C# and The API....
now if only I can stop the "bleeding in my brain" - haha!
good, creative ideas.
Thank You