Continue to Site

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!

MACRO SPLIT SURFACE IMPORTING POINTS FROM TXT FILE AND WRITING AREAS TO XLS FILE

Status
Not open for further replies.

CADlalala

Aerospace
Apr 3, 2014
43
GB
Hello Everybody,

I am fairly new in Catia macro programming and I am a bit stuck at the moment, I hope you can help me out.
Basically what I need to do is partitioning faces automatically keeping track on how the face area changes (before and after partitioning) by simply writing the areas in an excel file. The valid partition line is defined by a list of points imported from a txt file. I have attached a picture that explains the desired workflow.

So far I know how to import automatically the points. However I am unsure about how to proceed with the rest. In particular, I have problems implementing the following:

Foreach face in the CATPart:
{

If there are points laying on the surface:
{
1- Write Face Name in column A in the excel file (e.g. Face1)
2- Write area of the surface (before partitioning) in column B in the excel file.
3- Create line (spline) that connects the points on the face to create a partition line.
4- Split face.
5- Write Face Name of the split faces in column C in the excel file (e.g. Face1.1 and Face1.2)
6- Write area of the split faces on column D.
}

else (If there are NOT points laying on the surface):
{
1- Write area of the surface (before partitioning) in column A in the excel file.
}

}

Can you help me implementing this?

I have attached the macro for importing the points, an explanatory picture, the excel table where the surface area should be written and a CATPart.

If you could help me I would be very grateful!

Thank you very much!
 
 http://files.engineering.com/getfile.aspx?folder=0112f741-737a-4abb-af7c-b9e5f1e361d5&file=Question_Split_Face_Catia.zip
Replies continue below

Recommended for you

once you have the point imported, record the macro that will create the spline and the splits.

With that and some other script from FAQ, you should be able to do what you need.

You can also record some macro in excel when you set some value in some cell... you can use that for your script.

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

Part and Inventory Search

Sponsor

Top