Tutorial-How to export points from solidworks to a excel file!

the macro below used for exporting points from sketch to excel !

  1. Step 1:

    For example we have these points in the 3Dsketch Below to export to excel

  2. Step 2:

    go to tool --> macro --> new
    choose a name for macro and click save

  3. Step 3:

    In the programming window write code below ( download the .swp I attached, the whole code didn't fit in picture!)

  4. Step 4:

    Choose the sketch you want to export points from!

  5. Step 5:

    tool--> macro--> run

  6. Step 6:

    select the macro you write (or I uploaded) and click open

  7. Step 7:

    the points will be write in a excel file as below

Comments

  • himanshu khandelwal
    himanshu khandelwal 11 May, 2017 06:03 AM

    is it necessary that all the points must be only in one sketch?
    how can we export the coordinate from a single SLDPRT file but from different sketches .

  • Abhimanyu Jamwal
  • Ana Zajec
    Ana Zajec 9 Aug, 2017 08:26 AM

    very helpful but i cannot find the code file attached

  • William Banks
    William Banks 31 Oct, 2017 04:15 PM

    Great macro, but my resulting excel file had all duplicated points. Anything to fix this?

  • l yp
    l yp 28 Nov, 2017 12:56 AM

    good job!

  • Brian Brazeau
    Brian Brazeau 19 Mar, 2018 03:23 PM

    Hi This is great! You might want to add that you have to select a sketch before running the macro or it writes an excel file with just the xyz labels no data.

  • Joshua Liu
    Joshua Liu 19 Sep, 2018 08:29 PM

    What's the order when exporting all the points? What if I want to export points in a specific order, can this macro be modified to have order control?

  • Matthew Atlas
    Matthew Atlas 26 Aug, 2019 06:01 PM

    If your 3D sketch points have external references, say a coincident line, the script will also export the xyz values of the referenced line's vertexes. Is there a way to keep it from doing this?

  • Matt Zeleny
    Matt Zeleny 15 Jul, 2020 09:55 PM

    Another way to do it is to save the part as an IGES file, open up the options in the save dialog and check the option that says something like "include sketch data".

    Next, change the file extension from IGS to .CSV, then open it in excel. Pretty easy so spot the rows/columns that are applicable and then delete the rest.