cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

PARAMETER FOR NUMBER OF COMPONENTS PRESENT IN AN ASSEMBLY

Luca_Carraro
13-Aquamarine

PARAMETER FOR NUMBER OF COMPONENTS PRESENT IN AN ASSEMBLY

Hello everyone,

there is one function, in relation, wich returns a parameter  representing the number of components in an assembly. 

It would be the equivalent of the &rpt.qty parameter present in the table
report or the %$quantity parameter present in the BOM configuration file.

Many thanks for your time, greetings Luca.

 

 

21 REPLIES 21

Hi,

unfortunately, there is no such parameter on assembly level.


Martin Hanák

Hi Martin,

it seems impossible, it is a parametric software!

Luca.

tbraxton
22-Sapphire I
(To:Luca_Carraro)

This may be useful for you.

 

Use the Search Tool:

Click on Search > Component > Name.
Define the name or leave it blank to search for all components.
Click Find Now to get the number of items found

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
Luca_Carraro
13-Aquamarine
(To:tbraxton)

Hi, 

I’ve already tried this
I need a function, within relationships, I can’t do manual operations for what I need.

Same as these:
VOLUME=mp_volume("")
CODE=rel_model_name

etc...

for example invented : NUMBER_PARTS=rel_moldel_assembly_parts

Luca.

tbraxton
22-Sapphire I
(To:Luca_Carraro)

I believe @MartinHanak is correct, I am not aware of any function to support what you are asking for. You may be able to do it with a Creo Toolkit app assuming there is a function call to get the total # of components. I am not sure if such a function is available in toolkit.

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric

Hi,

I already told you that requested function is not available OOTB.

If you have some programing knowledge and Creo mapkey creation knowledge then you can create your own "function".

 

mapkey proposal:

  • it explodes model tree and saves its contents into text file
  • it calls compiled program (exe-file created using AutoIt or other programming tool) which digs requested information (part quantity) from text file and creates trail file which puts part quantity into specific parameter
  • runs trail file which puts part quantity into specific parameter

 

You can run the above mentioned mapkey before regenerate action.

 

 

For example: You can use AutoIt to develop script


Martin Hanák

Thank you Martin,
is already what I do to update some parameters related to the project folder name and other info.

But it seems like a tricky ride for to have a number that needs to be already written somewhere.

Greetings luca.

You probably won't find anything to give total number of components because the software does not care how many total components there are in an assembly. It only cares about how many of EACH component are in the assembly. True, once it knows how many of each, it could sum that and give total number, but since it doesn't matter to the software, the programmers have not done it.

If you feel it is important, then open an Idea in the community with supporting information as to why you need it, what benefit it will provide and how much time it will save your company to have that information.

Hi Ben,
I don't like this answer. I don't like this way of thinking.
If you go to a restaurant and they bring you water but not a glass, what do you say?
If we think like this, what does the programmer care about CAD?

The programmer does not think like a designer who uses a tool like CAD and therefore must not develop CAD as a programmer but as an end user.
The end user may also be interested in knowing how many parts there are in an assembly.

If I can know the mass, the mass properties, the center of gravity why can't I know how many components I have, through relations.
The same rules and relationships that I find in the repeat region of the table must also be found in the assembly environment in my opinion.

Greetings Luca Carraro.

 

 

 

Most of the programmers at PTC are computer science or math graduates, very few are mechanical engineers or CAD graduates, at least from my experiences. The managers who control the projects that the programmers work on are much more in tune with what is expected of a CAD system and the end user requirements.

The system that PTC has in place, like it or not, is to submit a request in the Ideas section of the community outlining what you think is a deficiency in the software, what you would like to see to improve it and explain why it is important to your company along with any projected savings. Once the idea is presented, other users may give likes to your idea. However, PTC management does not guarantee that any idea presented in the community may make it into a future version of the software. If there is another project that is working in the area of BOMs, then a 'simple' fix to sum all part quantities may be slipped in. The code for ModelCheck has the ability to sum the number of components and the number of unique com ponents in an assembly.

User enhancement requests or ideas do not drive software sales. If a company wants to buy 1000 seats of Creo but won't unless it has a certain feature, then that feature will become a priority to the CAD management team.

 

I was going to post an idea about making search results accessible in notes and relations - turns out I can't do this as my PTC Community account isn't linked to an active maintenance / subscription.

 

Anyway, here's the gist of it:

pausob_1-1715954438256.png

 

 

If someone is interested in submitting this as a Creo Parametric product enhancement idea, feel free to use the above picture.

I submitted this as a product enhancement idea.  Please vote if you like it.

tbraxton
22-Sapphire I
(To:Luca_Carraro)

If you are able to use repeat regions in a drawing table, then you can use this method.

 

  • The total sum quantity of all parts can be obtained if the following settings are made in the Relation section of the Repeat Region of drawing
    • IF asm_mbr_type == "ASSEMBLY"
      NUM= 0
      ELSE
      NUM=rpt_qty
      ENDIF
========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
Luca_Carraro
13-Aquamarine
(To:tbraxton)

Hi,

many thanks for the soluction, bat 
I already know this, in drawing tables,

I need to have a number inside the assembly file to handle relationships.

Luca

 

RPN
17-Peridot
17-Peridot
(To:Luca_Carraro)

You can use any parameter of your repeat region in that relation, but as far I read, you know that.

And I’m pretty sure that with „exist“ and the model name you are capable to increase a parameter of your own.
The only thing, I don’t know, to create a new integer var in a relation, and use it later for increase.

 

The assignment of a

  model_name_tag = appearance count,

by not knowing the variable, is an issue. I never tried to init a variable by using name, type and a tag by creating the names string upfront. For a static self created var, this should work.


You also may need a second table to filter and display the result.

 

Search in a string may work, to get an idea, and I would try to use the run time ID, this is unique (for flexible comp, this must be checked). 

 

I have Never tried 
LHS: A+itos(comp.id) = FooBar …

To create a var like A1234

 

I guess Creo will blame on you😉 with this LHS.

 

For the default relation, is there not an array a() or c() available? The index could be the search position of all run time ids.

 

The first component may have a component parameter, and a global statement, which will set the var to zero on Regen start.

 

To make that clear, this is a hack, and your colleagues will start crying 😢

 

So, write the Bom to file, parse it by a script, prepare and run a mapkey, may much easierヤ 

 

In Tookit this is quite simple, I would guess 1 day, depends of the requirement from your site, and how to identify the quantity vars later.

 


My 2 🪙

 

Hi,

as the others already mentioned, I don't think there is a OOTB solution. But there are two Modelcheck Check Names, called

 

NUM_COMPONENTS
UNQ_COMPONENTS

 

which represent the number of components (sum and unique) in an assembly.

 

Years ago I wrote a nested mapkey (1. regenerate modelcheck 2. OS-script: iterate through the newest modelcheck .xml file, look for the lines with these check names and their values 3. create these parameters in the assembly accordingly 4...) to get number of components in my assemblies. It is possible, but a really dirty solution.

 

Here is a PTC Tutorial to get the OVERALL_SIZE Modelcheck Check Name as a parameter:
https://www.youtube.com/watch?v=W1WAMeK-NNc

RPN
17-Peridot
17-Peridot
(To:Luca_Carraro)

I like this kind of a riddle, but if I understand your request, you want to have the parameter within your assembly, because you have no relations in a drawing.

 

Do you need a component parameter, in that case which component hold the summary.

 

Example relation line in an assembly:

count_of_com_box = compcount(“box.prt”,no) 

with the args, name of component and a recursive Boolean yes or no for flat.

 

But if you have this, there is no automation. Because the parameter name and the model name must be given by you. 

And again, you can format your own BOM output and parse that file.

Luca_Carraro
13-Aquamarine
(To:RPN)

Hi RPN,

I want to do what I do with the table in the drawing

(example relations used:

value_rtp_qty=rpt_qty*asm_mbr_valore
&rpt.rel.value_rtp_qty)
directly together without doing the drawing.

One system could be the BOM, but I want to manage it directly from the assembly.

Best Regards Luca.

 

 

I think this is useful and a sensible thing to ask for two reasons.

It's a common thing that CAD users might need to perform and that a CAD package should make it easier to perform.

 

When the software lacks functionality, a needed task might be done with a "workaround". In this case, it is putting notes manually, and having to review and very attentive to design changes. So, there might be lots of companies making this manually since there is (almost) no other option. For a CAD package that has PARAMETRIC in its name, this tarnishes a little bit the parametric nature of it for certain tasks.

 

The other option, to implement it via toolkit, which would be apparently a simple task for large to middle sizes companies, this might guarantee the parametric nature of results. But for small to medium sized companies, who lack knowledge with programming skills to use one of the toolkits available this is out of the question. And the other workaround of having to process modelcheck XML output files or processing trail text files is very cumbersome, and probably also not parametric in nature, since if the user changes the assembly and forgets to run the script, the results will not be updated.

 

It's better to add a simple and easy to add internal Creo function to the relation repertoire, to allo the user to call said function in a post regeneration relation.

 

Since MBD tables do not allow yet repeat regions, this request can be one way to enhance the possibility to add repeat regions inside an assebly level MBD table.

 

At least three functions would be useful:

 

1. One to count the component quantity in the current assembly level.

2. One to count the component in the current assembly level or any of sub-assembly levels.

3. One to count the component total instances in the top level assembly that the current assembly might be a member of.

 

The 3rd option would imply first an upward search to identify the top level assembly in which the assembly is a member of and then traversing down again to count the total number of instances. This option would have to be trated more carefully to avoid excessive regeneration times or repetitive loops.

 

Currently we have the problem of having to manually specify the number of quantity that a certain part is needed for a project to put it in the drawing legend. This is not possibile to be achieved without manual intervention. The user adds drawings for parts, not for components, so, at part level, there is no way to have the "quantity" available. This implies to have to perform manual editing of quantities for such drawings, which is error prone. There should be a way for Creo to automatically treat a drawing part as a component part in the context of an assembly, or a top level assembly to transfer those parameters to the part drawing. For companies that use Windchill this is solved problem, but for small companies, this remains an unsolved problem. We have drawings in different folders, that even if the drawing is for the same part, the quantities of said part will be different for different projects. Creo could update the quantities automatically for drawings saved locally on the same folder as an assembly or top level assembly.

RPN
17-Peridot
17-Peridot
(To:S_Edgenear)

In my opinion your statement is misleading. Pro/REPORT has a lot of feature you need to get the BOM out, or to display it on a drawing. It may depend on the type of license you have, or you currently use.

 

But after thinking about this issue, I would say it doesn’t make sense to have that kind of information managed at assembly level, because of parameter assignment.

 

At assembly level, specify the parameter you want to export, and your are done. But you must parse the data after this process.

 

The other option is to use repeat regions in drawings to have it somewhat automated, and export the table to file if required, including balloons.

A relation function would not help,  because you will end up to define manually a parameter for each component.

 

Windchill may help you out, but here I have currently the issue to export the find number and the line number (as component parameter) to a WTPart BOM Structure, because here CAD driven seems to end, So I can’t drive this two parameter from assembly level. Grouping, with flexible components will work only at CAD level. But no propagate to WTParts. But even for this, you must customize this process, no user wants to do this manually. 

And again, using Pro/REPORT Is the first step. Automation may Step two.

S_Edgenear
15-Moonstone
(To:RPN)

One way to solve it would be with a new added relations funcion:

 

comp_count(   "assembly name",  [ "part_name" ], [ consider_sub_assemblies ]  )

 

If used at the part level, the user could ommit "part_name" and it would consider the "self" part name, but would need to specify in which assembly. The third argument would be a boolean to specify recursion to sub-assemblies of said assembly.

 

If used at assembly level, the assembly name could be ommited, and the current assembly name would be considered, and the part name omitted or specified asterisk " * " to obtain what the original OP requested.

 

It would be usefull to use this relation at a part level or drawing level to obtain the quantity the said part is included in a main assembly, which the user could specify using its name, or even having another function to obtain the name of the top level assembly in which a part is a member of.

 

To count a specific component in an assembly:

 

count_of_comp = compcount("assembly.asm", "part_to_count.prt", true)

 

To count the current component in a top level assembly:

 

count_of_comp = compcount("top_level_assembly.asm", "", true)

 

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags