Reply

Robust SolidEdge App (Prevent from crashing)

Hello,

 

I've been running into a couple snags whenever I try to make solid edge batch print through many drawings. I've done the same thing with AutoCAD and also had that problem. Basically, waiting after the IDE while the .exe program keeps executing made the COM crash.

 

So I used Microsoft's solution for VS2010:

http://msdn.microsoft.com/en-us/library/vstudio/ms228772(v=vs.100).aspx

 

This works flawlessly for AutoCAD. Although (seeing an improvement) it still sometimes occurs with SolidEdge. I even have a release object after my DoIdles()

 

[code]Public Sub ReleaseObject(ByRef obj As Object)

Try

System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)

obj = Nothing

Catch ex As Exception

obj = Nothing

End Try

End Sub[/code]

 

For an even more far-fetched counter measure, I close and re-open SolidEdge after opening 50 documents. As it seemed it would always fail if it kept going too long. Does anyone have previous experience of preventing SolidEdge from crashing / Freezing?

 

Thank you

 

Posted by: Alex
Post date: 4/18/2013 1:57:57 PM

3 REPLIES

Robust SolidEdge App (Prevent from crashing)

try with use OLEMessageFilter (see Solid Edge SDK)

 

Posted by: JR
Post date: 4/19/2013 12:15:40 AM

Robust SolidEdge App (Prevent from crashing)

I don't know about totally preventing it but there are tips and tricks I've acquired over the years that I'd be happy to share. Let me put together a demo over the weekend. I'm working exclusively at http://solidedgesamples.codeplex.com these days so I'll put it there. I'll reply back with the project name so you can find it.

 

Posted by: Jason Newell
Post date: 4/19/2013 12:52:09 AM

Robust SolidEdge App (Prevent from crashing)

[ Edited ]

As promised, SolidEdge.Draft.BatchPrint has been added to [url=http://solidedgesamples.codeplex.com]http://solidedgesamples.codeplex.com[/url]. The magic you're looking for happens in the [url=http://solidedgesamples.codeplex.com/SourceControl/BrowseLatest#401556]buttonPrint_Click[/url] event. The link is to the C# source code because the VB.NET projects only get created for the releases. To help you along, I went ahead and converted this project and attached it to this post. The official release will come May 1st on CodePlex.

 

Hopefully I documented the source code well enough that you can understand what I'm doing. In a nutshell, by isolating the interop code to its own application domain, the COM references can be released when the isolated application domain gets unloaded. That means you don't have to worry about Marshal.ReleaseComObject() anymore.

 

Hope this helps. Have fun!

 

Posted by: Jason Newell
Post date: 4/22/2013 6:01:44 AM