Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

catia point extraction macro help

Status
Not open for further replies.

harlowmatt

Aerospace
Nov 11, 2014
71
US
thread560-322777
Hi everyone,
I am trying to us the script that camadian posted in the above thread (extract points to .csv). I keep getting a runtime error permission denied on line "Set data_file = filesys.CreateTextFile(file_path2, True)". I am using CATIA V5-6 RELEASE 2015 SP5 BUILD NUMBER 25. Can anyone help me out?
 
Replies continue below

Recommended for you

what about the script in FAQ?

Eric N.
indocti discant et ament meminisse periti
 
Are you sure you have permissions to save files at file_path2?
 
itsmyjob,
I am wanting to extract to excel so that I can import into a drawing and have what I call a live coordinate table so that if a hole location changes I can just update the table with out having to redo the entire thing. will the .txt file still do that?

JeniaL,
 
so I changed the drive that it saves to. now when I run the macro it completes but the excel file only shows what is under the WRITE HEADER section. Then the message box saying that the macro has finished running. its like it is skipping everything from BEGIN LOOP section and below to the end message box.
 
so now I inserted an axis system and made it current and get an error on "If VBA.Left(selection1.Item(i).Type, 16) = "HybridShapePoint" Then"
 
With this script solution, the excel/text file will not update by itself if points move...

There is a solution to have xyz of point in drawing linked with 3D but it is very time consuming to setup, it involves creating parameters in 3D for each X, Y and Z and creating drawing texts linked with 3D parameters...

I guess you should check with business and check if they need (or just want) a fully link XYZ table. I'm not saying scripting for link solution is not possible, but if it is what they need "you're gonna need a bigger boat"

Eric N.
indocti discant et ament meminisse periti
 
what kind of point you have?

real 3D points? intersection points? points (not construction) in sketch? please show picture of point in Spec Tree.

Eric N.
indocti discant et ament meminisse periti
 
Code:
If TypeName(selection1.Item(i).Value) = "HybridShapePoint" Then

Eric N.
indocti discant et ament meminisse periti
 
Code:
If TypeName(selection1.Item(i).Value) = "HybridShapePointCenter" Then



Eric N.
indocti discant et ament meminisse periti
 
that worked!!! thanks. is there a way for it to be in inches not mm?
 
Code:
 data_file.WriteLine nom & ";" & myArray(0)/25.4 & ";" & myArray(1) /25.4& ";" & myArray(2) /25.4 & ";" & selection1.Item(i).Type

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top