Coordinate Import in Autodesk Inventor

Target product: Autodesk Inventor 5.3/6/7/8/9/10/20xx
Date: 14.01.2014

Download VBA project

Installation

  1. Run Autodesk Inventor (AI)
  2. In the Tools menu select Macro Visual Basic Editor.
  3. In the Microsoft Visual Basic window select File Load Project.
  4. Select the project file ImportCoordinates.ivb.
  5. Close the Microsoft Visual Basic window.

Running

  1. In Microsoft Excel open the sheet with point coordinates.
    Note Coordinates must be stored so that X coordinates are in one column and Y coordinates in another column.
  2. In Autodesk Inventor start a new part file and a new sketch (or leave the active sketch).
    Warning This function requires an active sketch. If no sketch is active this function will not work.
  3. In the Tools menu select Macro Macros.
  4. In the Macros dialog, in the Macros in list select the All application projects and Active Documents option.
  5. In the Macro Name list select the Module1.ImportCoords item.
  6. Press the Run button.
  7. In the Point import dialog enter the values depending on the format of your data in the Microsoft Excel sheet (enter the number of column containing X-data, column with Y-data, etc.). The 3D points option imports 3D coordinates as WorkPoints (instead of 2D splines).

    For the Sample table use Rows range 2-132

  8. Run the macro using the OK button.
  9. After the macro finishes use the View Zoom All command to display the imported coordinates. They should result in a spline controlled by the values of Excel coordinates.
    Solid created using this macro. Courtesy of ING corporation, s.r.o.

Excel source Imported workpoints

Notes

  1. The Scale factor option converts units without the need to recalculate them in the Excel sheet - AI works internally in centimeters while most coordinates are read-in in millimeters. This conversion is driven by the value of 0.1.
  2. Use the decimal separator as set in your operating system locale - usually a comma (,) in Europe.
  3. The Close spline option allows to close automatically the created spline.
  4. Other than the scaling (scale factor) there are no processing performed on the imported coordinates. The resulting spline is an exact image of the coordinates from Excel - including their order and count.
  5. Current version has a reference to Excel 2002 XP Object Library. If you are using a different version of MS Excel (and getting Private oExcel As Excel.Application error - 'Project or Library not found'), you can change your Excel library using the following procedure:
    1. Go to Visual Basic Editor
    2. Select Tools References
    3. In the Available references list unselect Missing: Microsoft Excel 10.0 Object Library.
    4. Select the Microsoft Excel Library according to your installation (either 8.0 or 9.0 or 11.0) - do not select multiple Excel libraries
    5. Close the References dialog with OK button.

History

1.5 (17.4.2014) Named workpoints, Inventor 2015
1.4 (14.1.2014) PtrSafe option added for 64-bit Inventor 2014
1.3 (4.2.2004) 3D spline option for Inventor 8+, cell value checks, modified defaults
1.21 (19.11.2003) Inventor 8 and Excel 2003 supported
1.2 (30.7.2003) 3D points import, tooltips, small fixes
1.1 (17.5.2003) Inventor 7 support
1.0 (28.5.2002) First version

See www.cadstudio.cz/apps/importcoord for updates


Copyright © 2014 CAD Studio a.s.