Showing results for 
Search instead for 
Did you mean: 

Copy draw partlist content to excel



I`m new on a forum and i just started write a excel macros to solid edge.

I`ll honest that i dont know how started, so i`d like to ask us for help.

Can somebody send me a example how solve this problem... i`d like to copy partlist content and paste to excel, how looks comment wich connect excel with solid edge active document ?


thanks for help

thanks for examples




Re: Copy draw partlist content to excel

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

The Samples for Solid Edge project on CodePlex has an example. I attached a screenshot below to show you where to find the example. I also put together a Samples for Solid Edge (December 2013) - Getting started video on YouTube. Let me know if you still have any questions.



Jason Newell
Solutions Architect

Re: Copy draw partlist content to excel


HI Jason,


I tried use formula CopyToClipboardAndPastToExcel, but it doesn`t work, i couldn`t also find this formula in SDK :/ what works for all version SE ST ? thanks

Re: Copy draw partlist content to excel

Gears Honored Contributor Gears Honored Contributor
Gears Honored Contributor

Hi lauren86,


CopyToClipboardAndPastToExcel perhaps is not a Solid Edge API so you may not find in the SDK help.


Based on Jason's very useful sample, here's an over simplistic version of the program that copies the first PartsList found in a Draft document to a new file in Excel.


The requirements are:

1. Solid Edge should be running with a Draft document open with a PartsList inserted.

2. Excel Should be running.


I tested the below with SE ST 6, Visual Studio 2010 and Excel 2007


Imports System
Imports System.Collections.Generic
Imports System.Runtime.InteropServices
Imports System.Text

Module Module1
    Dim oApp As SolidEdgeFramework.Application = Nothing
    Dim oDoc As SolidEdgeDraft.DraftDocument = Nothing
    Dim partsLists As SolidEdgeDraft.PartsLists = Nothing
    Dim partsList As SolidEdgeDraft.PartsList = Nothing

    Dim oExcel As Microsoft.Office.Interop.Excel.Application = Nothing
    Dim oWorkBook As Microsoft.Office.Interop.Excel.Workbook = Nothing
    Dim oWorkSheet As Microsoft.Office.Interop.Excel.Worksheet = Nothing

    Sub Main()
        oApp = Marshal.GetActiveObject("SolidEdge.Application")
        oDoc = oApp.ActiveDocument

        If oDoc IsNot Nothing Then
            partsLists = oDoc.PartsLists

            If partsLists.Count > 0 Then
                partsList = partsLists.Item(1)

                oExcel = Marshal.GetActiveObject("Excel.Application")
                oWorkBook = oExcel.Workbooks.Add()
                oWorkSheet = oWorkBook.ActiveSheet
            End If
        End If
    End Sub

End Module


The Visual Studio 2010 project is also attached so you can try it readily. It does not contain any error checks. Hope you find this useful.