Catia V5 - Points to Spheres
Catia V5 - Points to Spheres
(OP)
Hello All,
I have excel sheets from which i have inported the point coords. now i need to draw a sphere on each of these points. i have around 35 files with an average of 350 points in each. any body know of a macro or any other quick way of creating or copying a sphere to all these points?
Thanks in advance,
Gary.
I have excel sheets from which i have inported the point coords. now i need to draw a sphere on each of these points. i have around 35 files with an average of 350 points in each. any body know of a macro or any other quick way of creating or copying a sphere to all these points?
Thanks in advance,
Gary.





RE: Catia V5 - Points to Spheres
If you have a KWA license you can fill a list of all the points then loop that list and create a sphere at the point.
Regards,
Derek
RE: Catia V5 - Points to Spheres
Knowledge approach has some benefits it will update if there are changes. If you go with the macro, that creates points from excel, check the code, you could maybe add the sphere operation there.
RE: Catia V5 - Points to Spheres
Thanks for your input, but it is all over the top for me. Any guidelines on how to do these procedures?
RE: Catia V5 - Points to Spheres
So where are you standing right now? Can you get the points into CATIA?
RE: Catia V5 - Points to Spheres
RE: Catia V5 - Points to Spheres
RE: Catia V5 - Points to Spheres
1) imports\export points (macro)
2) excel csv file with point parameters
3) catia v5r16 .catpart with imported points.
htt
ht
ht
RE: Catia V5 - Points to Spheres
Before you do anything go to tools/option and in the knowledge enviroment tab define a path for the architect resource creation path. (this will create a folder structure needed when working with ARM)
Start by creating an UDF that makes a sphere, this udf should have one input and that should be a point, rename the input to "Point". In the last tab "type" hit auto and generate to generate a gscript that will be stored in the folder structure created previously. Now create a catalog, name it ARMCatalog and add the udf feature, create keyword "Logical Name" and set the value to "Sphere" and the keyword "Type" and set the value to "UserFeature". Store both the UDF part and catalog in the folder "knowledgeResourcesCatalogs" which you will find where you defined the knowledge enviroment earlier.
Now to create the knowledge pattern. You can if you want it to be generic to create a part with some points in it so you can define a the pattern and make a power copy that you can use later. In the knowledge pattern window start with creating a new list and call it SphereList. Add the code below:
let i(integer)
let PointList(list)
let ListSize(integer)
let Sphere(UserFeature)
/* Getting all point from Geometrical Set.1 in the list, PointList that will be used to create the UDF on one point at the time and setting the while loop */
PointList='Geometrical Set.1'.Query("Point","")
ListSize=SL->Size()
/* UDF instanciation, in the first line ARMCatalog is the name of the catalog found in the knowledge enviroment folder "knowledgeResourcesCatalogs" Sphere is the feature with the logical name, SphereSet is the name of the geometrical set where the udf should be created. Second line is to map the UDF inout parameter Point to the point on the list*/
i=1
For i while i <=ListSize
{
Sphere=CreateOrModifyTemplate("ARMCatalog|Sphere",SphereSet ,`Relations\KnowledgePattern\SphereList` , i)
Sphere->SetAttributeObject("Point",SphereList ->GetItem(i))
EndModifyTemplate(Sphere)
i=i+1
}
Had to describe it on top of my head so it may not be perfect:)