Content Center Input and Filename - Trim trailing and leading zeros from input

Content Center Input and Filename - Trim trailing and leading zeros from input

Matthew_Policelli
Advocate Advocate
627 Views
4 Replies
Message 1 of 5

Content Center Input and Filename - Trim trailing and leading zeros from input

Matthew_Policelli
Advocate
Advocate

We have many content center families with an input for the dimensions of the part - for example, wood where the user inputs the length. The filename is set from the wood board size and the length input by the user.

 

One issue we have is that there does not seem to be a way to trim trailing or leading zeroes. As a result, for a 10" piece of wood, the inputs 10.0, 010, 10.00, and 10 will result in four different files for the same exact part.

 

Is there a way to trim leading zeroes from the input so that all of the above inputs would result in the same filename?

 

More info if it helps:

The File Name is an identifier for the family, with a dash, and the the PARTNUMBER column. Here is the properties page for the PARTNUMBER column:

Matthew_Policelli_0-1689165899445.png

 

628 Views
4 Replies
Replies (4)
Message 2 of 5

CGBenner
Community Manager
Community Manager

@Matthew_Policelli 

Hi, Matthew.  After some quick testing, I don't see any way to set this so that it can trim the zeroes as you suggest.  I've asked internally if there is any way to limit what acceptable formats can be entered here for length, but it may be a training issue for your users.  I'm hoping to get some feedback, and I will follow up if I hear anything.

Meanwhile, I open the floor to our community experts to tell me that I'm way off on this one!  🙂  Maybe there is a custom solution out there, or an obvious one that I've missed?

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!



Chris Benner

Community Manager - NAMER / D&M


0 Likes
Message 3 of 5

CGBenner
Community Manager
Community Manager

@Matthew_Policelli 

I've been reminded of THIS thread from a while back relating a very similar question, and offering  couple of ways to solve this.  Maybe something in here can be of help to you?

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!



Chris Benner

Community Manager - NAMER / D&M


0 Likes
Message 4 of 5

Matthew_Policelli
Advocate
Advocate

Sorry I never got back to this. This comes up every once in a while and I get back to it - today I tried setting up a column to round the user input which will trim leading and trailing zeros.

 

I used this formula in the Height_Cleanup column, for example: (round(({HEIGHT}*16 ul)/1 in)*1 in)/16 ul, where our tolerance is +/- 1/16"

 

I then set the filename, member, and linked part parameters to this Height_Cleanup column instead of Height (which is the one the user inputs).

 

This did trim extra zeros for the file name and in the part, but the disadvantage is that because the key parameter is set to the formula, doing a change size afterwards returns the formula instead of the value:

Matthew_Policelli_0-1777904022669.png

 

Now, I can make it so that just the member and filename are trimmed, but then if the first file of a given size is made with leading or trailing zeros, that part will always have those leading or trailing zeros in the change size dialog. This is probably fine, since it's just a visual thing.

 

Alternatively, I could use iLogic to detect if a filename's custom inputs have leading/trailing zeros, and replace it with a cleaned up version when the user saves. This would probably be cleaner than adding a "cleanup" column to every single Content Center family that has custom inputs.

 

In the end though, these are just workarounds, and I feel like there should be a way to set number formatting for input columns on the Content Table level. This is something that can be done in Excel cells, so it is not unheard of.

 

0 Likes
Message 5 of 5

Roman_Vesely
Autodesk
Autodesk

Hi Matthew,

Thank you for reporting this — and for sharing the workaround!

To confirm:
this is the current expected behavior in Inventor. When generating a Content Center part filename, Inventor uses the input values exactly as entered — without any numeric normalization. So 10, 010, and 10.0 are treated as distinct strings and will produce separate files. There is no built-in option to trim leading or trailing zeros from input values before building the filename.

The approach you described — adding a formula/rounding column in the family table that normalizes the value before it's used in the filename — is the recommended workaround for custom CC libraries.

If you'd like to see a native normalization option added to Inventor, I encourage you to post this as a feature request on the Inventor Ideas portal: https://forums.autodesk.com/t5/inventor-ideas/idb-p/inventor-ideas-en

Ideas that gather enough votes from the community have a strong chance of being considered for a future release.

Best Regards
 Roman



Roman Vesely

Inventor - Principal QA Engineer