Tutorial-How to import points to solidworks from a text file !


Follow The Procedure Below

  1. Step 1:

    first you should check the format of the text file
    only x y z separated by space no headings, comas or ...

  2. Step 2:

    open a new part
    tool--> macro --> new
    choose a name for it!

  3. Step 3:

    then you will go to the programming window (usually visual basic )!
    type the program below (or you can download .swp that i upload)

  4. Step 4:

    pay attention
    note1 : check the directory (location) of the file
    note2: it inserted the point in meters!

  5. Step 5:

    save the macro and go to the solidworks part window

  6. Step 6:


  7. Step 7:

    select the macro you wrote

  8. Step 8:

    the points will be imported as below in 3Dsketch

  9. Step 9:

    now you can do what you want with the point!

    i wanted to make surfaces that cross the points!


Please log in to add comments
  • Missing feed
    Dinushika Karandeniya

    When I run this macro for my data it ended up with Run-time error "438": Object doesn't support this property or method.
    Error is in this line "Part.ShowNameView2 "*Isometric", 7"
    Could you please help me with this?

    November 1st, 2018 04:39
  • Missing feed
    Shivanand Prabhudesai

    Thanks, This method helped me a lot and saved lot of my time

    July 3rd, 2018 05:42
  • Missing feed
    Alex Tress

    Hi, I have got up to Step 8 and completed it fine, but how did you do step 9, at the moment mine is just coordinates

    March 28th, 2018 18:09
  • Missing feed
    Atanas Kolev

    Exactly what I was looking for :) Thank you. Great job

    November 27th, 2017 21:37
  • Missing feed
    M G

    Whenever I run the macro, I get the error "91 : Object variable or With block variable not set". Can you please help me with that?

    April 18th, 2017 14:08
  • Missing feed
    Miklos Zsolnay

    Great stuff. Worked very well at the beginning. But suddenly I get 'runtime error 52', can anyone help on this ?

    March 29th, 2017 06:30