×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

extract point position to excel

extract point position to excel

extract point position to excel

(OP)
in the attachments a .Catpart file in which i need to extract points position into an excel or a .txt file if any one could do this for me or help me , i'd be grateful....
Thanks in advance

RE: extract point position to excel

Hi,

Your points are done on a sketch, so easy way is to save CATPart as igs file.

The igs file can be open with WordPad or Scite or Notepad++ (it will keep the text formatting) or with any other software which can read files based on text inside - case of the igs files. Usually you can see the coordinates of the points in the rows which start with number 116 (which if I remember correctly means point in igs files).

In your particular case search for Sketch.1 and under this row you will find what you need, for example:

116,0.0,1004.704829,156.6925468,0,0,0; 1P 1
116,0.0,1002.391412,159.007152,0,0,0; 3P 2
116,0.0,1001.717075,162.2252189,0,0,0; 5P 3
116,0.0,1002.839395,165.292717,0,0,0; 7P 4
116,0.0,1005.358351,167.4462534,0,0,0; 9P 5
116,0.0,1008.178667,169.1814322,0,0,0; 11P 6

That means for first point is at x=0.0 y=1004.704829 z=156.6925468

Last 3 zero numbers on the same row is the position of the axis system…..

Of course you can do this also in Excel, still, be aware of numbers of the rows limitation in Excel - no more then 63500 if I remember correctly...


Regards
Fernando

RE: extract point position to excel

(OP)
Thank You fredo,, you made my day :)

but what does 1p, 3p , 5p means ,, why they are odd ??!!??

i can't help thanking you frdo :)

RE: extract point position to excel

Well, best explanation here http://en.wikipedia.org/wiki/IGES#File_format

Regards
Fernando

RE: extract point position to excel

hi,
with this macro you can extract all point in CSV file
you can find in attach the extract of your part

all the best

Sub coord_points()

'*********
'SETTINGS
'*********
Dim filesys, testfile
Set partDocument1 = CATIA.ActiveDocument
Set filesys = CreateObject("Scripting.FileSystemObject")


'*******
'INPUTS
'*******

file_path = InputBox("Chemin du fichier de sortie:", "Chemin", "C:\")

'**************************
'CREATION OF OUTPUT FILE
'**************************
file_path2 = file_path & "data_file.csv"
Set data_file = filesys.CreateTextFile(file_path2, True)

'***************
'WRITE HEADER
'***************
data_file.WriteLine "Position des points"
data_file.WriteLine "Nom;X;Y;Z"

'************
'BEGIN LOOP
'************
Dim selection1
Set partDocument1 = CATIA.ActiveDocument
Set selection1 = partDocument1.Selection

selection1.Search "type=CATGmoSearch.Point,all"
nombre_point = selection1.Count

For i = 1 To nombre_point

If VBA.Left(selection1.Item(i).Type, 16) = "HybridShapePoint" Then


Set point_selected = selection1.Item(i).Value
ReDim myArray(2)
point_selected.GetCoordinates myArray
nom = point_selected.Name


Else
ReDim myArray(2)
myArray(0) = "N/A"
myArray(1) = "N/A"
myArray(2) = "N/A"
nom = "N/A"
End If

'******************
'ADD DATA TO FILE
'******************


data_file.WriteLine nom & ";" & myArray(0) & ";" & myArray(1) & ";" & myArray(2) & ";" & selection1.Item(i).Type



Next

data_file.Close

MsgBox ("Operation est teminée")

'****
'END
'****
End Sub

RE: extract point position to excel

from the FAQ...

http://eng-tips.com/faqs.cfm?fid=1377

Eric N.
indocti discant et ament meminisse periti

RE: extract point position to excel

Any idea why http://eng-tips.com/faqs.cfm?fid=1377 returns an empty file?
Or not totaly empty, just no points data.
------------------
"Points Extraction from CATIA"

"Name , X , Y, Z"
--------------------------

The manual way that ferdo posted is not ideal but I have used it. It is just so much work to manually(yes using automated tools, still lot of work) edit the exel file to get the points. I need to extract several thousand points from several files.

I am using Catia V5R19 with LMS Virtual Lab 9-SL3 running on top of it. Doesnt help to run just Catia, same problem.

RE: extract point position to excel

from the script:
This scipt scan a Geometrical Set named 'Points' in a Part
Then get XYZ of points (values in mm)
and create a report as a Text file located in d: drive


Make sur you have all points in 1 geometrical set and its name is Points.

Eric N.
indocti discant et ament meminisse periti

RE: extract point position to excel

Hi,

I remembered an old thread and search function helped me to find it smile

http://www.eng-tips.com/viewthread.cfm?qid=239531

And bellow is a newer version of Eric's catvba (from same thread), see if is working (there are still some conditions to work, your part is done in hybrid design ?

http://files.engineering.com/getfile.aspx?folder=4...

What was posted by camadian is working (I didn't have the opportunity to test it) ?

Regards
Fernando

https://picasaweb.google.com/102257836106335725208

RE: extract point position to excel

Thank you Eric. The geometrical set was not named Points. But when I did name it I got the following result.

-------------------------------
"Points Extraction from CATIA"

"Name , X , Y, Z"

"Point.575",,,
"Point.576",,,
"Point.577",,,
"Point.578",,,
"Point.579",,,
"Point.580",,,
"Point.581",,,
"Point.582",,,
.
.
.
---------------------

Now it finds the points but doesnt get any values out of them. Could the problem be that the points are actually following a curve made out of several components with "Join". The points have only length parameter visible.

From the igs file you can get the coordinates with no problem. Just lot of work.

RE: extract point position to excel

can you post you file?
I am still using R18

Eric N.
indocti discant et ament meminisse periti

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources