AddIn vs COM Automation

Hi guys,

 

I'm new to SolidEdge development and I have two main questions.

 

First of all, why should I choose to create and AddIn instead of automating SolidEdge through COM from an external .exe? I bet that from an AddIn I’d have better control over events happening inside SolidEdge (like MouseMove), better way of integrating dialogs and a more complete API?. One of my main objectives for my next project is to allow the user to select points and edges in his model.

 

Secondly, if I choose to go with the AddIn method, the .Net way seems to be strongly rejected by the main expert here (by the way thx for your awesome work Jason ). There seems to be a lot of problems related to .net development in AddIns. Could somebody just share a link or post some explanations about what are the disadvantages of using .net.

 

Thanks a lot !

 

Posted by: David Shooner
Post date: 1/31/2012 3:23:17 AM

6 REPLIES

RE: AddIn vs COM Automation

Posted By David on 31 Jan 2012 09:23 AM

Hi guys,

 

I'm new to SolidEdge development and I have two main questions.

 

First of all, why should I choose to create and AddIn instead of automating SolidEdge through COM from an external .exe? I bet that from an AddIn I’d have better control over events happening inside SolidEdge (like MouseMove), better way of integrating dialogs and a more complete API?. One of my main objectives for my next project is to allow the user to select points and edges in his model.

 

Secondly, if I choose to go with the AddIn method, the .Net way seems to be strongly rejected by the main expert here (by the way thx for your awesome work Jason ). There seems to be a lot of problems related to .net development in AddIns. Could somebody just share a link or post some explanations about what are the disadvantages of using .net.

 

Thanks a lot !

David,

When comparing the differences of Addins vs Macros, I suggest first getting your mind around In-Process and Out-of-Process Components.  It really boils down to what your needs are.  In an addin scenario, you get loaded with Solid Edge and you are "In-Process".  With a macro, you are "Out-of-Process".  Macros are a good place to start because they are easier to code than addins.  The Solid Edge API is large compared to most other APIs out there and does take time to learn.  I think it's fair to say we are all still learning ;-).

Honestly, I have not done a good job leading this community with examples and tutorials since I first started the site in 2005.  There are various reasons that I won't bother going into right now but I can tell you that JasonNewell.NET is going to be undergoing major changes this year and part of those changes include me getting back in the saddle of leading the Solid Edge development community.  A lot has changed in the programming world since I made some of those comments about .NET and addins.  I still think C++ is the best natural language for writing addins but .NET has improved in ways that encourage me to take another look at things.  I don't have anything tangible to give you right now but I do plan on having something soon.

 

 

Posted by: Jason Newell
Post date: 1/31/2012 4:38:27 AM

RE: AddIn vs COM Automation

Thank you for your fast answer Jason!

 

As for the “in-process” and “out-of-process”, I’m pretty aware of the differences. I have created my share of AutoCAD applications and the API is different depending if we are in or out-of-process. In-process, we create a DLL using the C++ ARX toolkit, out-of-process we use the ActiveX automation toolkit. The in-process API allows a deep customization like creating our own entities and handling events on a low level. The out-of-process one is simpler but a lot of options are not available. That’s why I was asking. At first glance it seems to me that all of the functionalities available while doing macros are available while creating an AddIn.

 

We are always learning and that's what awesome

 

I look forward using your forums for my upcoming development, thank you again for your great work.

 

Posted by: David Shooner
Post date: 1/31/2012 6:32:34 AM

RE: AddIn vs COM Automation

David,

Sounds like you've got a good head start then.  As far as the Solid Edge API is concerned, you use the same COM API in addins and macros.  Addins have the benefit of running during the duration of the session whereas macros lifetime are much more targeted in scope.

In case you haven't discovered these yet, I'll mention them.

Working with Add-insThis document is written by an in-house SE developer and is pretty much the best document out there covering everything addin related.C:\Program Files\Solid Edge XXX\SDK\Samples\Addins\Doc\addin.doc

Solid Edge ST Addins - Part IThis is an article that I wrote awhile back to help people get up to speed on the basics of creating a new addin.  I've also published Visual Studio templates but they are dated and need to be updated (* Included in the new stuff I mentioned that is coming).

Good luck and let us know if you need help.

 

Posted by: Jason Newell
Post date: 1/31/2012 6:43:55 AM

RE: AddIn vs COM Automation

Hi David, Hi Jason,

 

just my 2 cents. I've made not too bad experience in programming Solid Edge addins under .NET in C# or VB. It gets more complicated when it comes to give the addin a GUI which integrates into Solid Edge's infrastructure. But that's mostly because you have to know a lot about pure WIN32 programming in that area and its often confusing too, because the Solid Edge GUI changed to the ribbon style some releases ago, but the API internally still keeps the old names dealing with toolbars, groups etc.

 

Another thing i don't understand, why only the DISE* interfaces are working instead of the everywhere documented ISE* interfaces. Hopefully Jason can give us an answer to this. A second caveeat is that Visual Studio IntelliSense doesn't show some of the Solid Edge event objects. You have to type them in blindly!?

 

Jason, i'm looking forward for your new stuff you announced above. Many thanks for your engagement allover the last years.

 

 

Posted by: Wolfgang Kunert
Post date: 1/31/2012 7:08:18 AM

RE: AddIn vs COM Automation

Hi Jason,

 

thank you very much for your links and your crystal clear example !

 

Hi Wolfgang,

 

Thanks a lot for your inputs

I've looked into the ISE vs DISE stuff and it seems that the referenced assemblies setting, "Embed Interop Types", must be set to false.

It then enables us to use the ISE ones instead of the DISE ones.

 

Here is an explanation why, i'll take more time to check that tomorrow.

http://msdn.microsoft.com/en-us/library/dd997297.aspx

 

Posted by: David Shooner
Post date: 1/31/2012 9:14:17 AM

RE: AddIn vs COM Automation

Hi David,

 

i'm not sure, but i think i observed the problem, not being able to get addin events working using the ISE stuff, already before .NET 4. When there was no option to get Interop types embedded. But thanks for that hint.

 

Posted by: Wolfgang Kunert
Post date: 1/31/2012 9:58:17 PM