GetExternalLinkInfo Dimension Variable

I want to rename my linked variables and give them the same name as the variable where the link come from, but I have problems with dimensions!

How can I use the GetExternalLinkInfo for a variable with the type dimension?

 

Example:

Dim ObjVariables As SolidEdgeFramework.Variables

ObjVariables = objDoc.Variables

Dim isLinked As Boolean = True

For Each ObjVariable As SolidEdgeFramework.variable In ObjVariables.Query("*")

Try

If ObjVariable.Formula.Contains("@") Then

If TypeOf ObjVariable Is SolidEdgeFrameworkSupport.Dimension Then

Dim VarName As String = ObjVariable.Name

Dim SourceVariableName As String = ""

Dim SourceDocumentName As String = ""

ObjVariables.Item(VarName).GetExternalLinkInfo(SourceVariableName, SourceDocumentName) 'Here is the problem!!!!!!!!!!

If VarName <> "MaterialThickness" Then

ObjVariables.Item(VarName).Name = SourceVariableName

End If

Else

Dim VarName As String = ObjVariable.Name

Dim SourceVariableName As String = ""

Dim SourceDocumentName As String = ""

ObjVariables.Item(VarName).GetExternalLinkInfo(SourceVariableName, SourceDocumentName)

If VarName <> "MaterialThickness" Then

ObjVariables.Item(VarName).Name = SourceVariableName

End If

End If

End If

Catch ex As Exception

End Try

Next

 

Posted by: marthijn van Leeuwen
Post date: 12/17/2012 8:26:36 AM