Some Simple NET questions (I think)

Valued Contributor
Valued Contributor

 

Hi,

Simple questions, but with very probably complex answers, if I've guessed right....

I recently made the transition from VB6 to .NET and I'm using VS2008.

I've successfully built some reliable apps in .NET that reference Solid Edge through COM and the interops, but I'm about to commence developing my first .NET app that needs to 'interact' with SE via the mouse and command objects. I can see that the old controls have been 'deprecated' in V20 and that I now need to create them as objects when the application launches.

My previous .NET apps have simply created an instance of SE in the background and have been of the 'batch processing of files' type thing... You get the idea...

My new app is actually a 'port' of an app I created n VB6 that was an ActiveX EXE. In the good old days, I would simply declare a project as an ActiveX, compile the DLL somewhere and add it into the SE toolbar as a macro. To debug,  I'd then 'run' the app. VB would sit there patiently waiting for the macro to get fired by SE and leap into action when a breakpoint was hit or an error occurred.

Also, at runtime, my VB6 app would behave very nicely in SE. Whilst the command was active, the form persisted in the foreground, bailed out during view manipulation commands for example and then returned on a right-click, just like a regular SE command.

I'm pretty sure that the level of integration i need between SE and my app doesn't justify the effort of creating a full-on add-in. I went through this once in VB6 and subsequently wished I hadn't! The pain of figuring it all out just wasn't worth it in the end, given the lack of complexity in the app. From what I've read so far, the pain is x10 in .NET.

So, I've had a look at the new .NET MouseApp and nSidePolygon projects and I'm not able to figure what's going on at all, or how to setup a .NET project that operates anything like it did in VB6. The sample projects seems to be flawed, in that when you run each app, an instance of SE must be running or it won't start. So, you start SE and then run the app. Now, when the icon is clicked in SE that launches the app, a click in an SE window pushes the apps form behind the SE window. Nasty! That won't do at all! The MouseApp project just looks like a plain old forms app that doesn't actually 'integrate' at all (unlike its VB6 equivalent if I remember right). The nSidePolgon seems to give clues about how to achieve what I want, but I can't see how you would debug it! I can run the app from SE, but how do I set breakpoints, trap errors? What do I need to do in order to get VS to manage running of the code when the command is fired from SE? I know I'm missing really basic stuff here, but can someone help me on my way?

All I need is some useful pointers. Something I can look at that gives me some clues! Do I have to create an add-in to integrate properly with SE? All my app needs to do is collect information about some objects in a draft sheet and add things like attributes, etc. I need just one icon in the SE toolbar that brings up my apps form which will contain some additional commands and a listview to display information.

Hope someone can help this .NET novice!

 

Posted by: Dave Rothan
Post date: 11/12/2008 1:58:47 AM

1 REPLY

RE: Some Simple NET questions (I think)

Valued Contributor
Valued Contributor

Hi Dave,

 

All my app needs to do is collect information about some objects in a draft sheet and add things like attributes, etc. I need just one icon in the SE toolbar that brings up my apps form which will contain some additional commands and a listview to display information.

 

On this page, in the download section, you will find an Addin skeleton for .net 2005. Get familiar with it, its pretty straight foward. You can set breakpoints in VS2003/2005/2008 by clicking on the left margin of a line (project must be in Debug mode). For an addin I think (I'm not sure) you can use the "Attach to process" function in VS. In VS2008 go to Tools-->Attach to process and select the process to attach i.e. your addin.

 

hth,

Sibi

 

Posted by: Seb Sosna
Post date: 11/12/2008 5:43:45 AM