Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

removing trailing zeros in parts list qty field using object attribute relationships

Status
Not open for further replies.

crecore

Mechanical
Mar 11, 2010
64
I have an assembly which uses one material stocked by the foot. The drawing default units is inches and most of the qty columns are per (normal qty of an item). I created in expression in this component part file (also in inches) linked to the sketch perimeter. I then have it converted to feet and then rounded to the nearest hundredth (x.xx) with another epxression. Then I linked this expression to a part property.

In the assembly I have edited the qty cell and created a relationship to the part property of that component in the assembly via object attribute.

In the component, I did have to make the file part property unitless or else NX converts it back to inches, displaying the incorrect value.

In the assembly parts list I also had to set the cell style format to text and I added a suffix of FT (although this is also noted in the description of the components).

The issue remaining is that I have trailing zeros displaying in the parts list qty field of this item. It should display .87 feet for example (as it does in the component expression and in the components file property, but instead it displays .870000. Is the problem with the parts list, how the rounding was performed? I do not see any settings in the cell, column or parts list styles that control this. I also shut off trailing zeros in annotation preferences and this had no effect.

thanks

NX 8.0.1.5
 
Replies continue below

Recommended for you

What you will probably need to do is create another expression in the component part linking the current expression that is in hundreths of a foot and rounding that number up (using ceiling) to whole feet, and that new expression will be called out in your parts list.
 
Thanks guys. I changed to rounding in the component expression to (CEILING(((LENGTH_FT/12)*100)+.5))/100 which yields a good result. However, the problem remains so it must be in the formating of our parts list which is a site standard and dragged in from a table pallet. Our administrator can make changes in the template file but we are not sure what the fix is. I have linked an image of both the part property that I am linking and how it appears in the parts list.

NX 8.0.1.5
 
 http://files.engineering.com/getfile.aspx?folder=0631900e-b83c-431c-8ad7-4456940f4676&file=trailing_zeros_parts_list.JPG
<W!433685@LENGTH_FT_ROUNDED>

NX 8.0.1.5
 
If a number is the only thing in the cell (as indicated by your last post), you can change the cell style format to number and specify the number of decimal places you wish to display. If there is more text in the cell with the number (as indicated by your screenshot) it ignores the number style format.

As a workaround you might want to link to one of your expressions in the note instead of an attribute. Open the annotation editor, expand the 'text input' -> 'symbols' sections, choose relationships -> insert expression -> link to part, choose the part that contains your length expression, the expression of interest, finally change the format and press OK. The value of 'format' (mine shows as 0.2) will determine how the number is displayed; a zero before the decimal point indicates no leading zero (a one would give you a leading zero), the number after the decimal is how many places you want displayed after the decimal. This will fill out your text input section with something like: <X0.2@drf_1>
Copy and paste this text into your tabular note cell and add any additional text you wish.

www.nxjournaling.com
 
Cowski....very helpful! Previously I had to change the format to text to get it to display something other than "1"; as there is one of these items in the assembly. This was even with the cell linked to the part attribute. I also found that if I left the tables (parts list) style set to "highlight manual text" that the proper result didnt display either. Yes, I was running manual parts list updates and trying this after every change. Just now I changed the format back to number and edited the number of places. Then I did a parts list update. It did not change (still indicating x.xx0000). I then, relinked the cell to the part attribute and it updated to x.xx as I desire!! I think there is an order of operations that is needed here because I get mixed results. So it is working but it is a little flukey.

As for your second suggestion (not a work around, just a slightly different approach) I hadn't tried this, but it works as well!

This is how we forge new ground. We get an application to try something, we do, then we share these things once a week. Someone else may experiment with it or expand on the process in a different manner and we move on. Eventually, we decide on best practices and which ones are more effort than they are worth. How do others do these things?

thanks!

NX 8.0.1.5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor