Highlighted

Problem of opening SE ST assembly VB.net 2008

Valued Contributor
Valued Contributor

 

Good Morning,

I'm new about SE Programming,

Im' using VS 2008 and Solid Edge ST.

I'm trying to open an assembly get the part list and open those files to put value in the variables.

Now i'm having problem to open an assembly.

My document after that is open in the Solid Edge enviroment, but the value of objAssembly is nothing

I recive this error when i try to open an assembly or a Part Document but not for draft documents.

 

" Interface is not supported (Eccezione da HRESULT: 0x80004002 (E_NOINTERFACE))"

I'm using this code :

  Dim objApp As SolidEdgeFramework.Application = Nothing

        Dim objDocuments As SolidEdgeFramework.Documents = Nothing

        Dim objAssembly As SolidEdgeAssembly.AssemblyDocument = Nothing

        Dim objAssemblySync As AssemblyDocument = Nothing

        Dim objDraft As SolidEdgeDraft.DraftDocument = Nothing

        Dim objPart As SolidEdgePart.PartDocument = Nothing

        Dim objPartSync As PartDocument = Nothing

        Dim objSheetMetal As SolidEdgePart.SheetMetalDocument = Nothing

        Dim objWeldment As SolidEdgePart.WeldmentDocument = Nothing

        Dim objVariable As SolidEdgeFramework.variable

        Dim PartList As SolidEdgeDraft.PartsLists = Nothing

        Dim objType As Type

        Try

            objType = Type.GetTypeFromProgID("SolidEdge.Application")

            objApp = Activator.CreateInstance(objType)

            objApp.Visible = True

            objApp.DisplayAlerts = True

            objDocuments = objApp.Documents

            objAssembly = objDocuments.Open("C:\layout_prova\impianto\impianto.asm") ERROR LINE

 

 

            ' Turn alerts back on

            objApp.DisplayAlerts = True

        Catch ex As Exception

            Console.WriteLine(ex.Message)

            Me.Text = ex.Message

        Finally

            If Not (objAssembly Is Nothing) Then

                Marshal.ReleaseComObject(objAssembly)

                objAssembly = Nothing

            End If

            If Not (objAssemblySync Is Nothing) Then

                Marshal.ReleaseComObject(objAssemblySync)

                objAssemblySync = Nothing

            End If

            If Not (objDraft Is Nothing) Then

                Marshal.ReleaseComObject(objDraft)

                objDraft = Nothing

            End If

            If Not (objPart Is Nothing) Then

                Marshal.ReleaseComObject(objPart)

                objPart = Nothing

            End If

            If Not (objPartSync Is Nothing) Then

                Marshal.ReleaseComObject(objPartSync)

                objPartSync = Nothing

            End If

            If Not (objSheetMetal Is Nothing) Then

                Marshal.ReleaseComObject(objSheetMetal)

                objSheetMetal = Nothing

            End If

            If Not (objWeldment Is Nothing) Then

                Marshal.ReleaseComObject(objWeldment)

                objWeldment = Nothing

            End If

            If Not (objDocuments Is Nothing) Then

                Marshal.ReleaseComObject(objDocuments)

                objDocuments = Nothing

            End If

            If Not (objApp Is Nothing) Then

                Marshal.ReleaseComObject(objApp)

                objApp = Nothing

            End If

        End Try

    End Sub

 

Posted by: Filippo Mazzella
Post date: 2/6/2009 2:40:55 AM

4 REPLIES

RE: Problem of opening SE ST assembly VB.net 2008

Valued Contributor
Valued Contributor

Filippo,

 

With the release of Solid Edge ST, you cannot assume that a .asm will always be a SolidEdgeAssembly.AssemblyDocument and you cannot assume that a .par will always be a SolidEdgePart.PartDocument. The reason is that the files can now either be "Traditional" or "Synchronous" as they have the same file extension. Documents.Open() returns a generic IDispatch pointer so you need to use SolidEdgeFramework.SolidEdgeDocument. Once you have the SolidEdgeDocument, you can check it's Type property to determine what time of document you're dealing with.

 

So the problem that you're seeing (I'm assuming) is that the .asm that you're trying to open is "Synchronous" rather than "Traditional".

 

Make sense?

 

Posted by: Jason Newell
Post date: 2/6/2009 3:51:00 AM

RE: Problem of opening SE ST assembly VB.net 2008

Valued Contributor
Valued Contributor

 

Thanks for the response Jason,

i'm actually working with "Traditional" solid edge documents, or better theese documents come from S19 Version and converted to ST.

I will try to open it as a document and we will see the result.

Thanks for everithing

 

 

Posted by: Filippo Mazzella
Post date: 2/9/2009 8:50:31 PM

RE: Problem of opening SE ST assembly VB.net 2008

Valued Contributor
Valued Contributor

 

Hello Jason , here i'm again...

Unfortunatly i dint get success with my try.

It's very strange.

Now im' tryng to get the active session, and get the active document(a .par file), without success.

 

In attach you will find my problem(the same as before)

There is something i can do to going ahead?

Mayb some setting in ST or something ?

Thanks in advance,

Filippo

 

 

Posted by: Filippo Mazzella
Post date: 3/3/2009 1:36:35 AM

RE: Problem of opening SE ST assembly VB.net 2008

Valued Contributor
Valued Contributor

I've installed MT4 update and everithing now it's ok!

Strange, but i think i get some problem with the istallation.

 

 

Posted by: Filippo Mazzella
Post date: 3/3/2009 3:37:00 AM