I use WF2.
I have a model with some points (it's not a CMM file, it's a "normal"
part) and I need to get a file (text file o similar) with the 3D
coodinates (X, Y, Z ) of these points.
Is it possible in an automatic way ?
Any help is welcome.
Depends on how you created the points. If they were created as 'Offset CSYS',
'Edit> Definition' will show you an interface panel with a Save button. This
create a named .pts file with xyz coordinates in a list for each point. I don't
think I've seen any other way to create points that will let you save this way.
Makes sense since you're creating the points referencing a common csys.
I have points created in different ways, for instance as intersection
between curves and surfaces or as a pattern of start point.
My scene is :
a curve on plane
a point pattern on curve
a axis pattern on points
intersection between axis ans surface.
In this way I got 3D points.
I'd need the have the coordinates of these points in order to drive a
I hope it's clear.
David Janes wrote:
> Depends on how you created the points. If they were created as 'Offset CSYS', then
> 'Edit> Definition' will show you an interface panel with a Save button. This will
> create a named .pts file with xyz coordinates in a list for each point. I don't
> think I've seen any other way to create points that will let you save this way.
> Makes sense since you're creating the points referencing a common csys.
From a post I found in this group years(?) ago.
If your using windows you can export your file to iges, and run the
below VBS script.
If your using a Unix system, you may be able to code a similiar script
with tools like sed, vi and the like.. (any offers?- its been a long
time since I've scripted a unix shell)
' Extracts location of points from IGES file and writes to text file.
' Requires input filename as argument: iges2pt.vbs inputfile.igs
ON ERROR RESUME NEXT
Set objWSO = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Define InputFile
InputFileName = WScript.Arguments(0)
' Need Error Trap to prompt if filename not provided.
InputFileName = objFSO.GetAbsolutePathName(InputFileName)
Set InputFile = objFSO.OpenTextFile(InputFileName, 1, False)
' Define OutputFile
Set OutputFile = objFSO.CreateTextFile("Points.txt", 2, True)
' Define RegExp for Type=116 (Points)
Set objRegExp = New RegExp
.Pattern = "^116\b"
' Process Data
Do Until InputFile.AtEndOfStream
strLine = InputFile.ReadLine
' If Type=116
If objRegExp.Test(strLine) then
' IGES format uses 'D' in scientific notation. Replace
D with E.
strLine = Replace(strLine, "D", "E")
' Split by commas.
arrParts = Split(strLine, ",")
' Write x y z to output file.
strLine = arrParts(1) & " " & arrParts(2) & " " &