Parts List, include columns and rows and Delete

Hello!

I created a VB code that corresponds to the PartsList command.

What I'm trying now is to access the properties through a Part ListPartsList Properties -> Data, and have access to rows, columns, and can delete them or add new lines.

Can you help me?

See the code snippet.

 

The Dim objApplication SolidEdgeFramework.Application = Nothing

The Dim objDocument SolidEdgeFramework.SolidEdgeDocument = Nothing

The Dim objDraft SolidEdgeDraft.DraftDocument = Nothing

The Dim objModelLink SolidEdgeDraft.ModelLink = Nothing

The Dim objDrawingView SolidEdgeDraft.DrawingView = Nothing

The Dim objDrawingViews SolidEdgeDraft.DrawingViews = Nothing

The Dim objSheets SolidEdgeDraft.Sheets = Nothing

The Dim objSheet SolidEdgeDraft.Sheet = Nothing

The Dim objModelLinks SolidEdgeDraft.ModelLinks

Dim view As Object = ""

The Dim ObjPartlist SolidEdgeDraft.PartsLists

The Dim ObjPart SolidEdgeDraft.PartsList

Try

 

objApplication Marshal.GetActiveObject = ("SolidEdge.Application)

MessageFilter.Register ()

objDocument = objApplication.ActiveDocument

If (objDocument.Type DocumentTypeConstants.igDraftDocument) Then

MessageBox.Show ("The list of material to be generated from a draft." Failed "in the type of file", MessageBoxButtons.OK, MessageBoxIcon.Information)

Exit Try

End If

objDraft = objApplication.ActiveDocument

GOOD = New ClassBOM

objModelLink objDraft.ModelLinks = (0)

objModelLink.UpdateViews ()

ProcessAssembly (objModelLink.ModelDocument)

objModelLinks = objDraft.ModelLinks

objSheet = objDraft.ActiveSheet

objDrawingViews = objSheet.DrawingViews

For Each objDrawingView In objDrawingViews

view = objDrawingView

'ObjDrawingView.Delete ()

Next

 

ObjPartlist objDraft.PartsLists = ()

If ObjPartlist.Count = 0 Then

objDraft.PartsLists.Add (View, "ISO", 0, 1)

Else

For Each ObjPart In ObjPartlist

ObjPart.Update ()

Next

End If

 

Catch ex As Exception

If objApplication Is Nothing Then

MessageBox.Show ("SolidEdge not found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

Else

MessageBox.Show (ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

End If

 

Finally

If Not (objApplication Is Nothing) Then

Marshal.ReleaseComObject (objApplication)

objApplication = Nothing

End If

If Not (objDocument Is Nothing) Then

Marshal.ReleaseComObject (objDocument)

objDocument = Nothing

End If

If Not (objDraft Is Nothing) Then

Marshal.ReleaseComObject (objDraft)

objDraft = Nothing

End If

If Not (objModelLink Is Nothing) Then

Marshal.ReleaseComObject (objModelLink)

objModelLink = Nothing

End If

End Try

End

 

Posted by: Edson Silva de Jesus
Post date: 12/30/2010 6:15:49 AM