Import XYZ Points from external source

Post Reply
User avatar
Site Admin
Site Admin
Posts: 615
Joined: Thu Feb 09, 2017 4:07 pm

Import XYZ Points from external source

Post by CrashN8 » Tue Jan 29, 2019 11:10 am

CMM-Manager has built-in Import Points Operation that allows importing point data from external source such as 3rd party metrology software. Maybe this 3rd party system lacks CAD and reporting capabilities needed for the current task... If so, just import you point and CAD data to CMM-Manager and perform Alignment, Feature constructions, Best-Fitting, Reporting, etc. See specific example for processing points from Inspec software from MicroVu vision system here


Point data format can vary to some extent... For example both formats shown below are acceptable. Typically the data should be comma delimited and could contain Point Name, X, Y, Z, I, J, K. The Point Name should start with alpha character, afterwords CMM-Manager automatically detects XYZ / IJK data.
// name: CAD_CLOUD < total_points: 2205 >
// probe radius: 0.0000000
// X Y Z
1.7131581, 0.0000000, -67.0721419
5.2486686, 0.0000000, -70.6076524
8.7841529, 0.0000000, -74.1431367
9.1457864, 0.0000000, -74.5047703
9.0714713, 1.7695448, -76.2000000
Or this...
RefFrame,Use Current
Probe Diameter,0.00000
, X, Y, Z
Unfortunately the data coming from Automeasure software is a bit strange since it contains Point label that only includes Numeric text, thus confusing the CMM-Manager import mechanism that is trying to automatically distinguish a difference between numeric point data and alpha-numeric point labels. Automeasure file looks something like this:
So now we use VBScript to Read, edit, and then re-write the file from Automeasure so that it is usable in CMM-Manager. In summary this Script prompts user for input file, reads input file, removes blank lines, ignores lines that start with "//", and then writes each line to a new file while adding "P" to the Point Label. Here is the script:

Code: Select all

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWShell = CreateObject("WScript.Shell")
Set ChooseFile = objWShell.Exec( "mshta.exe ""about: <input type=file id=X><script>;new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(X.value);close();resizeTo(0,0);</script>""" )
MyFile = ChooseFile.StdOut.ReadAll

'strip out Carriage Return
ChrPos = InStr(MyFile, Chr(13))
ChrPos = ChrPos -1
MyFile = Left(MyFile, ChrPos)

'Create file for writing
MyFileOut = "C:\ProgramData\Nikon\xyz_data_file.dat"
Set objFileOut = objFSO.CreateTextFile(MyFileOut)

' Open file and read all lines
Set objFile = objFSO.OpenTextFile(MyFile, 1)
i = 0
          Do While objFile.AtEndOfStream = False
               MyLine = objFile.ReadLine
           If Left(MyLine, 2) = "//" Then
               MyLine = "P" + CStr(MyLine)
                i = i + 1
            End If
objFile.Close      'close input file
objFileOut.Close  'close output file
When you run the CMM-Manager program you will see the standard Windows file selection dialog, like this:


Once the script runs you should see points imported automatically. The remaining program could include Alignment, Feature Constructions, Reporting, etc. It is typical to use CAD for Best-Fitting and Comparison in these cases. See attached example file including Automeasure XYZ Point data file.

Enjoy ;)
You do not have the required permissions to view the files attached to this post.

Post Reply