Showing results for 
Search instead for 
Did you mean: 

Get Variable List on 64bit failed

Valued Contributor
Valued Contributor



I have a problem getting the VariableList of a Document.

We are using SE V20 and winXP 32bit. When using the program on a winXP 64bit I can't get the vaibles List.

I always get the error: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

when using this code: objVariables = objDocument.Variables.Query(pFindCriterium:="*")

Does anyone knows whats the problem or had the same problem.

Here the complete code (This function returns a collection of variables with does not match a regexp experssion):

Public Structure SEVariable

        Dim displayName As String

        Dim value As Double

        Dim formula As String

        Dim isExposed As Boolean

        Dim exposeName As String

    End Structure


    Public Shared Function getVariablesByRegExp(ByRef objDocument As SolidEdgeFramework.SolidEdgeDocument, ByVal regExp As Regex) As Collection

        Dim variables As New Collection

        Dim variable As SEVariable

        Dim objVariables As SolidEdgeFramework.VariableList

        Dim currDOMType As String = ""


            objVariables = objDocument.Variables.Query(pFindCriterium:="*")

            For Each varObj As Object In objVariables

                currDOMType = Microsoft.VisualBasic.Information.TypeName(varObj)

                If currDOMType.Equals(DOM_VARIABLE_TYPE) Or _

                    currDOMType.Equals(DOM_DIMENSION_TYPE) Then

                    Dim isValid As Boolean = False


                        isValid = regExp.IsMatch(varObj.displayname)

                    Catch ex As Exception

                        Throw New Exception("validating SE variable [" & varObj.displayname & "] failed. Msg: " & ex.Message)

                    End Try

                    ' take all variables that doesn't match the regular ex

                    If Not isValid Then

                        variable = New SEVariable

                        variable.displayName = varObj.displayname

                        variable.value = varObj.value

                        variable.formula = varObj.formula

                        variable.exposeName = varObj.exposeName

                        variable.isExposed = (varObj.expose = 1)

                        variables.Add(variable, variable.displayName)

                    End If

                End If


            ' release objects

            objVariables = Nothing

        Catch ex As Exception

            Throw New Exception("[getVariablesByRegExp] Reading variables from SolidEdge failed. Exception: " & ex.Message)

        End Try

        Return variables

    End Function


br Flo


Posted by: Florian Tree
Post date: 6/29/2010 5:00:29 AM