Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
This there a way to extract the model units ( inches / mm ) directly from the model and add them to a parameter so they can be shown in the title block area?
I know we can have ModelCHECK can add the parameter to the model and then we can read that parameter, but we don't want to have to rely on ModelCHECK.
Lance
Hello,
I expect that model units are set when you create new part (and will not change later). Therefore you can create the appropriate parameter in start part.
Martin Hanak
Hi,
I agree with martin. Set the required units in the start part. While creating a new part use the start part.
Regards
Radheesh
Hi Lance...
I've wanted to do this for some time. The quick answer is that you cannot simply grab a system parameter which contains this information. This is true in WF3 and WF5 (not sure about Creo 1.0 yet though). You can grab the information through J-LINK, Toolkit, and other programming sources but this is tedious and painful (especially if you have no experience with these packages).
HOWEVER, there is a way to get what you're looking for using a combination of relations and parameters. You can also display this information in a BOM using Pro/REPORT. Unfortunately, this technique is limited in that you must use new parameters for them to work.
(1) Open a model, run a mass properties report using Setup>Edit>Mass Props>Generate Report. In WF5, it's File>Properties>Mass Properties>Change>Generate Report. This step is required so default mass properties values are generated. The values themselves are irrelevant... so it doesn't matter if your density is wrong. We just need default values so we can pull UNIT information.
(2) Open the RELATIONS tool. Under the Utilities tab, make sure Units Sensitive is checked.
(3) Add one or more of the relations below. I've added all of them to my start parts so they're always available. I've also added them to my "Post Regeneration" relations so they're not usually visible and they run after the part has been regenerated. If you don't know what "Post Regeneration" relations are, don't worry- these work anywhere.
UnitsMass = PRO_MP_MASS
UnitsDensity = PRO_MP_DENSITY
UnitsLength = PRO_MP_COGX
My variables are "UnitsMass", etc but you can change the names. To experienced users, this step will seem redundant! The three system variables PRO_MP_MASS, PRO_MP_DENSITY, and PRO_MP_COGX always exist after you're run an initial Mass Properties report (Step #1). Why set 3 NEW variables that appear to do nothing?
With NEW variables and the Units Sensitive switch set, those 3 new variables will retain not only the value but also the UNIT information from the three system parameters. With existing parameters, this isn't possible. Without the Units sensitive switch, it isn't possible. You need both.
(4) Save the relations; Regenerate the model. If you get an error, you've either skipped step #1 or you've mistyped something.
(5) Open the PARAMETERS tool. Under UnitsMass you'll see the value of PRO_MP_MASS but also, in the units column, the mass units for that value. This goes the same for UnitsDensity and UnitsLength.
If it's possible in ModelCheck to examine these units, you're home free. I suspect it's not that easy.
To view the units information in Pro/REPORT (or on a BOM) use the report parameter &asm.mbr.ptc_unit.<variable_name> where <variable_name> is UnitsMass, UnitsDensity, or UnitsLength. (ie. &asm.mbr.ptc_unit.UnitsLength).
Summary:
I typically set those three relations in my start part and hide them away under the "Post Regeneration" tab. Typically I don't need them. However, occasionally we get requests for a top level breakdown of all mass properties (mass, CG, and units) for a large assembly. Using Pro/REPORT and a custom table, I can list every part and it's associated mass, CG, and units.
Pulling the units data using Toolkit or JLink (or possibly even Weblink) is more direct but much more cumbersome. Using this technique you can leverage the capabiltiy of new parameters to retain units information and use that data downstream.
Not sure if that gets you through ModelCheck... but it does give you the information you wanted.
Thanks!
-Brian
PS: Be aware some people may direct you to pull the units information directly from the Pro/E MATERIAL file. This is a dead end. While you can pull this information, the units in the material file are static. They do not update and will not change if you switch your model units between IPS and mmks.
Hi Brian,
We are currently employing the same method to report mass properties of a model.
mass=pro_mp_mass. and it's on the post regeneration window. However I want to find out what might be the draw backs of calling up the properties directly from the system reported mass.
Couldn't we just use &asm.mbr.pro_mp_mass in the case of the Assembly BOM using Pro/REPORT and for our component drawings, we currently use &mass to display the mass, can't we just use &pro_mp_mass.
I can't think of a scenario where this would prove inconvenient. Do you know maybe of the shortcomings of doing it like this?
Thanks.
Hi Tshepo..
There should be no drawback to simply using &asm.mbr.pro_mp_mass
Setting a relation mass = pro_mp_mass really doesn't do anything for you as far as the mass goes. It's not saving you anything. In fact, it's just adding an extra relation you don't need. So then why have it at all?
My long post above was showing you how to grab the UNITS of the mass value... not the mass value itself. If you just need the mass value, you can just use pro_mp_mass. If you want to know what units that mass value is being reported in, you have no way to get it.
By using the technique I gave in that really long email, you can grab those units. Sometimes people set the units incorrectly and this can negatively impact your final mass props calculations. The technique I outlined provides a method to grab those units. Now you can report both the mass value and the units. These values can be reported in a BOM or in the model tree so you can check them and verify they're correct.
Just to be crystal clear... you don't need to set that extra relation (mass=pro_mp_mass) unless you're interested in the units. Most people don't care about the units- until they hit a problem and then they want to report the units and can't get them. This technique (above) solves that problem.
Thanks!
-Brian
Brian,
I think I didn't explain my question correctly. I was wondering if there is a way to pull the Units of your part ( inch or mm) without using a toolkit or jlink.
I am looking to add it to our MDB start part title page in a parameter. Something linke &UNITS which would show IN or MM ect......
Thanks,
Lance
Hi Lance...
The technique I posted doesn't use toolkit or jlink. It just uses regular old relations placed in your start part. You can create a mapkey to add these relations to an existing/legacy part or assembly. Once you follow the five steps in the original email and all of your components have the three relations with the Units Sensitive option turned on, you can access the units at will.
In a drawing, you'd use &asm.mbr.ptc_unit.<variable_name> but in your start part you'd just have three parameters: &unitslength, &unitsmass, &unitsdensity.
If you wish, you can just call it &units and just add the single relation which gives you the units of length:
Units = PRO_MP_COGX
Follow all the other steps but just enter ONE relation (above) and you'll have the parameter you're after.
Thanks!
-Brian
I set the following:
Tools, Relations, Utilities, Unit Sensitive
Add the relation:
Unitslength = PRO_MP_COGX
I see the new parameters and the column Unit which shows "in"
Added the note:
&Unitslength
It only shows the value. Your examples use it in an assemble table.
Do you know to add it to a parameter outside of an assembly table?
Hi there....
The problem is that this technique really only works for tables. You're making use of a repeat region parameter to pull in the units. Unfortunately without some programming wizardry, you're stuck at this point. BUT... if you can be a little flexible you might still be able to get what you need.
First... check out the image below...
The note on the left is similar to what you have. The UNITS come out as a value instead of the actual units you want to see. Because the parameter you need to grab the units is a repeat region parameter, you need a table (even if it is a small one). So, the table in the center can be made to give you what you want. Notice how the units show up correctly there.
Finally, the table on the right comes oh so close to being exactly what you need. It's still a table but I've used the Line Display option on the Table tab (not the regular Line Style command) to erase all of the internal lines of the table. This makes it appear to be a simple note. Unfortunately you cannot erase the outside borders of a table (why, PTC, why?!) otherwise this would be your solution.
However, maybe you can embed this unit information in your title block somehow? If so, you can use this technique to give you what you need. I've switch the symbols on in the view below so you can see what parameters I used to create each note/table:
Notice because I did not have an assembly, I used &mbr.ptc_unit.unitslength as my parameter. Also notice that the "&" doesn't show up on the variable names. I used:
I know this isn't quite what you need... but it's as close as you can get right now. I hope that helps somehow.
Take care...
-Brian
To view the units information in Pro/REPORT (or on a BOM) use the report parameter &asm.mbr.ptc_unit.<variable_name> where <variable_name> is UnitsMass, UnitsDensity, or UnitsLength. (ie. &asm.mbr.ptc_unit.UnitsLength).
If use &asm.mbr.ptc_unit.unitsdensity in BOM, it cannot be shown correctly
I think maybe cause the "/", "^" is the invalid character for parameter value, so it cannot be shown is BOM.
Is there any resolution about it?
Bin...
The three parameters UnitsLength UnitsDensity and UnitsMass were all tested and they work for me. Of course those three parameters can be called anything you want. It's critical though to use new parameters with the Units Sensitive option turned on as in the original email. Otherwise, nothing works.
If UnitsDensity isn't working, are you sure there's a material set for your part? Have you run a mass properties report at least once? Do you see an actual density value in your mass properties report?
We must be missing something because this works perfectly for me. I haven't tried it lately in Creo 2 but I'll give it a shot and write back if it fails.
Thanks!
-Brian
Hi Martin
Thanks for your reply.
I did the test one more time in Creo 2.0 M030, and the result is same as last time in Creo Elemets/Pro 5.0 M160.
Also, I upload the test data, could you take some time to review my data and point out something wrong of it.
Thanks
Chen Bin
Bin,
please read https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS126392 article (section 4.). I think it contains information you are looking for...
Martin Hanak
Hi Martin
This article is created by me
I observed the problem about "/","^" when I followed your method, so I noted it in this article.
And I would like to get some information from you about this problem -- Resolution or Work to SPEC
BTW, could you call-out the density units in the repeat region tables?
Thanks
Chen Bin
Bin,
I am little bit confused ...
You are PTCEmployee and you are asking how to work with Creo on this forum ...
Please report this bug to PTC R&D and ask them to resolve it.
Martin Hanak
lol... I never noticed that Martin! That's kind of insane.
What's more insane is that 5 years later with Creo 5, it is still not fixed!! They even added report parameters for detail drawings!
Hi Bin...
Just use the text below (red) in place of &asm.mbr.ptc_unit.unitsdensity in your repeat region:
&asm.mbr.ptc_unit.unitsmass/&asm.mbr.ptc_unit.unitslength^3
Density is just mass/volume. As long as your volume units are the same as your length units (which they should be), then this works. I do not know why "mmks_dens_unit" comes up instead of the actual units... but this is a way to get the value to show up properly.
I agree with Martin Hanak... this is a bug. Please go ahead and get it fixed for us!
Thanks!
-Brian
That's cool.
I will file a SPR to R&D.
All thanks to two Martin
Thanks
Chen Bin
Hi Brian,
I followed your guide and I was able to make it work almost perfectly, but I'm having problems because my mass values don't update automatically. I'm using CREO 2.0, can you or anyone help me out??
Best Regards,
Guilherme
I noticed that in Brian's post above where he shows two images, the 2.500 only goes to 3 places.
Does anyone know how to take it to 6 places? PRO_MP_MASS report actually shows 6 places (1210.717622)
Hi,
you can edit note containing a parametr name and add [.6] behind it.
Martin Hanak
Hi Lance,
If one of the responses helped resolve your issue, would you please mark it as the Correct Answer? That way other users visiting the discussion will know; as the correct answer gets copied right below the question.
Thanks,
Amit