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!

count the number of nodes or elements in a group (PCL) 1

Status
Not open for further replies.

nekcorp

New member
Mar 3, 2015
12
Hi,

I would like to use a PCL to count the number of the nodes or elements in a specific group or current group display with a PCL.

May be a function exists ?

Thanks
 
Replies continue below

Recommended for you

If I remember correct, there was a Patran Utility Menu function for this. Try checking all the functions for groups in Patran.

If you can't find any, Patran has 3 main PCL references, and from these, you can find relevant functions to call these elements and nodes after searching for it some time.
I've written a whole Patran menu function before that calls all the nodes and elements in a group and uses these to extract freebody loads. So below I'll put which functions they are and you can try to get them to work according to your needs:


Function for NODEs: db_count_nodes_in_group(group_id_sized(my_numbers),group_node_count(my_numbers))
Function for ELEMENTs: db_count_elems_in_group(group_id_sized(my_numbers),group_elem_count(my_numbers))


As you may figure, "group_id_sized(my_numbers)" & "group_node_count(my_numbers)" are the arrays I used in my own PCL Utility Menu Function Compilation.
So, your "group_id_sized(my_numbers)" will actually be your "input" GROUP ID in Patran - which is assigned by Patran when you create a group (1,2,3...etc).
"group_node_count(my_numbers)" will be the output you will get from this function.
Likewise, "group_elem_count(my_numbers)" will be the other output you will get from the other element count function.

I used "my_numbers" variable to be able to work with 1000-10000 groups at once for the Utility function I was compiling. So, this is the reason why you are seeing it in this format.
If you spend some time (ie. 1-2 weeks) with PCL references, I can assure you that you will figure out how the whole Patran system works and how to customize anything you want not only for PCL session file creations, but also for whole Patran Functions Programming..

Spaceship!!
Aerospace Engineer, M.Sc. / Aircraft Stress Engineer
 
Hi aerostress82,

Thanks a lot for your answer.

But what do you mean about Patran Functions Programming ? Patran is write with PCL, so what is the difference beetween PCL en Patran Functions Programming ?
 
Patran has an interface such as the menu buttons you use on the right and the Utility Menus that are in the top menu buttons.
Patran functions programming is programming a Patran Utility menu like the ones you see when you check the Utilities.

The difference between Patran session files and Patran Utility menu is that, Utility Menu is a function button (compiled by you) built into Patran menus/utilities/or to the right of the screen(at some "sub menu" of Patran) - you can further advance the already compiled menus & icons if you feel the need.

Patran is so customizable and easy to understand (thanks to the Fortran + C coding) that once you feel that you are missing a function that would help you, you could build that function and embed it into Patran.


I did something like this before for a major supplier of Airbus (while doing structural sizing for a primary structure too) and that function alone enabled us to reduce the whole process to 2-3 days instead of 10-15 days (time deducted by %80!!). I'm not working for MSC Software, I just plain love Patran. I also use 3 more FEA pre-processors too. Comparing to all other Patran is a winner to me with someone who knows how to work it..


I would automate most tasks there and spare more time for research in all my projects thanks to Patran again :) (I might have got too excited after the 2nd line-sorry for the long text, just wanted you to know its perks better since you are already using session files)

Spaceship!!
Aerospace Engineer, M.Sc. / Aircraft Stress Engineer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor