Export Work Points to Excel from Inventor 2015

Export Work Points to Excel from Inventor 2015

Anonymous
Not applicable
1,339 Views
2 Replies
Message 1 of 3

Export Work Points to Excel from Inventor 2015

Anonymous
Not applicable

Is there a way to Export Work Points to Excel from Inventor  2015

0 Likes
Accepted solutions (1)
1,340 Views
2 Replies
Replies (2)
Message 2 of 3

FrodoZhou
Autodesk
Autodesk

Hello,

 

There is no UI workflows allow you to do that yet, however, this little VBA code will help you collect all the work points data in a part document and save the data to a text file under your C drive. Hope this is helpful.

 

Sub CollectWorkPoints()
Dim oComp As PartComponentDefinition
Set oComp = ThisApplication.ActiveDocument.ComponentDefinition

Dim oWorkPoint As WorkPoint
Dim oPoint As Point

Dim oFSO As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")

Dim oFileout As Object
Set oFileout = oFSO.CreateTextFile("C:\WorkPoints.txt", True, True)

For Each oWorkPoint In oComp.WorkPoints
Set oPoint = oWorkPoint.Point

oFileout.Writeline oPoint.X & "," & oPoint.Y & "," & oPoint.Z
Next

oFileout.Close
End Sub

Message 3 of 3

Anonymous
Not applicable
Accepted solution