Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Catia V5 - Points to Spheres

Status
Not open for further replies.

gcpdesign

Automotive
Feb 2, 2005
64
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.
 
Replies continue below

Recommended for you

Gary,
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
 
Sounds possible to do with a macro but haven't tried it. If you get your points into the part(think there are some macros available on different forums) then you need PKT (Product Knowledge Template), the loop(still existing in KWA) has been replaced by the Knowledge Pattern in PKT and to loop non datum geometry you need an UDF. In short you need to create an UDF, and under the type tab crate a gscript and then store in an ARM catalog. The you create a Knowledge Pattern where you collect all the points with a list and add the UDF on them.

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.
 
Hi Guys,
Thanks for your input, but it is all over the top for me. Any guidelines on how to do these procedures?
 
Do you have access to either KWA(Knowlesge Advisor) or PKT(Product Knowledge Templates)?

So where are you standing right now? Can you get the points into CATIA?
 
I have a macro which i can use to import the points from csv to catia. the point all come in position and with their names. so from here onwards. i could make the macro available if it would help? i can go the PKT route.
 
I'm more into knowledgeware but we have people on the forum that could assist in scripting so publishing could help. So beside inporting the points from a csv table you want to create spheres. If you have PKT, not sure what you answered, I can help you set up a knowledge pattern.
 
PKT(Product Knowledge Templates) will be fine. The files attached are:
1) imports\export points (macro)
2) excel csv file with point parameters
3) catia v5r16 .catpart with imported points.



 
Ok, lets give it a try...

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:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor