Points Coordinate export

Hi people. 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. Bye Pier

Reply to
Pier Dil
Loading thread data ...

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.

Reply to
David Janes

Hi 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 CNC Machine. I hope it's clear. Bye Pier

David Janes wrote:

Reply to
Pier Dil

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)

VBS script:

' iges2pt.vbs ' Extracts location of points from IGES file and writes to text file. ' Requires input filename as argument: iges2pt.vbs inputfile.igs OPTION EXPLICIT ON ERROR RESUME NEXT Dim objWSO Dim objFSO Dim InputFileName Dim InputFile Dim OutputFile Dim strLine Dim objRegExp Dim arrParts 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 With objRegExp .Pattern = "^116\b" End With ' 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) & " " & arrParts(3) OutputFile.Writeline strLine End If Loop 'Close files InputFile.Close OutputFile.Close

HTH.

Reply to
Stu

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.