MACRO SPLIT SURFACE IMPORTING POINTS FROM TXT FILE AND WRITING AREAS TO XLS FILE
MACRO SPLIT SURFACE IMPORTING POINTS FROM TXT FILE AND WRITING AREAS TO XLS FILE
(OP)
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!
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!





RE: MACRO SPLIT SURFACE IMPORTING POINTS FROM TXT FILE AND WRITING AREAS TO XLS FILE
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.
indocti discant et ament meminisse periti