why that not work


helo, I work in VB.net on Solidedge V19.

why that not work :



      Dim temp As Integer


        Dim objSheet As SolidEdgeDraft.Sheet

        Dim Drawingview As SolidEdgeDraft.DrawingView

        Dim Atributset As SolidEdgeFramework.AttributeSet

        Dim attribute As SolidEdgeFramework.Attribute

        Dim DrawingObjects As SolidEdgeFrameworkSupport.DrawingObjects




            objDoc = objApp.ActiveDocument ' --> OK


            objSheet = objDoc.ActiveSheet ' --> OK


            DrawingObjects = objSheet.DrawingObjects ' --> OK


            temp = objSheet.DrawingObjects.Count() - 1 ' --> OK




     Drawingview = DrawingObjects.Item(temp)   ' --> It Is Not OK he go to catch




            temp = 1

            For Each Atributset In Drawingview.AttributeSets

                System.Diagnostics.EventLog.WriteEntry("Av  --  Atributset.Item(temp)", "test 5")

                attribute = Atributset.Item(temp)

                System.Diagnostics.EventLog.WriteEntry("AP  --  Atributset.Item(temp)", attribute.Name.ToString())

                temp += 1



        Catch ex As Exception

            System.Diagnostics.EventLog.WriteEntry("createFileHypertexte", ex.Message)

        End Try


thank you


Posted by: Galoseau Mathieu
Post date: 6/26/2008 5:43:47 AM


RE: why that not work

.NET has 0 (zero) based arrays.COM has 1 (one) based arrays.objSheet.DrawingObjects.Item(index) returns an object so you cannot assume that it will return a DrawingView as you've done in your code.You need to download and install my Solid Edge Spy application. Browse to the DrawingObjects collection and you'll see what I mean.Imports System.Runtime.InteropServicesModule Module1 Sub Main() Dim objApplication As SolidEdgeFramework.Application = Nothing Dim objDraft As SolidEdgeDraft.DraftDocument = Nothing Dim objSheet As SolidEdgeDraft.Sheet = Nothing Dim objDrawingObjects As SolidEdgeFrameworkSupport.DrawingObjects = Nothing Dim objDrawingObject As Object = Nothing Dim objSmartFrame2d As SolidEdgeFrameworkSupport.SmartFrame2d = Nothing Dim i As Integer Try objApplication = Marshal.GetActiveObject("SolidEdge.Application") objDraft = objApplication.ActiveDocument objSheet = objDraft.ActiveSheet objDrawingObjects = objSheet.DrawingObjects For i = 1 To objDrawingObjects.Count objDrawingObject = objDrawingObjects.Item(i) Select Case objDrawingObject.Type Case SolidEdgeFramework.ObjectType.igSmartFrame2d objSmartFrame2d = objDrawingObject End Select Next Catch ex As Exception Finally If Not (objSmartFrame2d Is Nothing) Then Marshal.ReleaseComObject(objSmartFrame2d) objSmartFrame2d = Nothing End If If Not (objDrawingObject Is Nothing) Then Marshal.ReleaseComObject(objDrawingObject) objDrawingObject = Nothing End If If Not (objDrawingObjects Is Nothing) Then Marshal.ReleaseComObject(objDrawingObjects) objDrawingObjects = Nothing End If If Not (objSheet Is Nothing) Then Marshal.ReleaseComObject(objSheet) objSheet = Nothing End If If Not (objDraft Is Nothing) Then Marshal.ReleaseComObject(objDraft) objDraft = Nothing End If If Not (objApplication Is Nothing) Then Marshal.ReleaseComObject(objApplication) objApplication = Nothing End If End Try End SubEnd Module


Posted by: Jason Newell
Post date: 6/26/2008 10:40:26 AM

RE: why that not work

Hello, indeed Solid Edge Spy is related practice, but the screenshot following will

show that there is a problem?

I have a line and a TEXT which is a link on a document network. It is precisely

this link that I want to recover but Solid Edge Spy Do not count. What type is my Link? I have seen in a source VB6 a variable name = "UG_USER_HYPERLINK" how to read?


thank you


Posted by: Galoseau Mathieu
Post date: 6/29/2008 8:46:37 PM

RE: why that not work

I didn't see what you were talking about when I wrote my first post. I have since seen the issue. I've scoured the API documentation for that hyperlink but I can't find where they expose it. It's entirely possible that they don't expose it at all. I suggest that you submit a query to GTAC about what you're wanting and see if they can come up with anything.


Posted by: Jason Newell
Post date: 6/29/2008 8:53:02 PM

RE: why that not work


Sorry I do not know GTAC what is it?

  (I'm french is perhaps not the same abbreviation in french).

In addition, where I just find the API documentation for vb.net?


Thank you


Posted by: Galoseau Mathieu
Post date: 7/2/2008 2:41:59 AM