Showing posts with label trailing. Show all posts
Showing posts with label trailing. Show all posts

Friday, 30 October 2015

Reported Length


In one of my previous post I’ve shown you how to change length parameter format for steel shapes in Content Center (CC) so that assembly Bill of Materials (BOM) will have no trailing zeros and round up the value to a 1 mm increment.


On that post I gave you a bit of ilogic code that can change formatting of files you might have generated already which can come in hand and can be used with code injector.

At that time I didn’t realized that you might not use the assembly BOM to report your lengths but use the drawing Parts List so in this post we will look at doing just that.

If your company uses Parts Lists then you might be lucky and saved yourself a good couple of day’s work where you needed to copy all the default libraries to a custom read-write and then editing all the templates to report correct length parameters.

The Parts Lists can be formatted just like the parameter display and you can show/hide, trailing or leading zeros, units string or even change units to: in, mm, cm, m, ft, yard, mi, or microns.

Double click on your table or right click and choose “Edit Parts List...” either on the browser or graphical window.

Right click the quantity column and choose “Format Column...”. In the format column window you can specify a new name for the column, change text justification and most importantly you can change units formatting.


Click on “Apply Units Formatting” to activate the submenus. Now you can change trailing or leading zeros, change units type, units and precision. It can be configure to report a different measurement unit, to change decimal from "." to "," and you can choose if you need to have the units string displayed at all.


If you use the Materials List table style supplied with Inventor you will have to modify the Substitution tab in the format cell window. In the Substitution window you might have “Enable Value Substitution” and “When exists, use value of” PL. This is helpful for those that do Tube and Pipe where the reported parameter for pipe length is PL.


And of course there’s a catch. Your units will be rounded but you need to be careful because you can have it rounded up or rounded down. Both can cost you and rounding up an expensive material can be just as expensive as rounding down and not having enough to complete your design.


My settings will keep units to mm but will remove trailing zeros and set precision to 0 decimals. Most workshops will not need or manufacture to less than 1mm increments but this is for you to decide.

In this way you can keep the default formatting of CC and keep working with the out of the box libraries without the hassle of copying or editing them.

Later,
ADS


Thursday, 17 September 2015

Length parameter format

Those of you working with frame generator or with content center steel shapes know that in order to get the length parameter to display correctly you need to edit the parameter formatting.

So how do we change the content center steel shape template?

Now you have two options:
The first one would be to open the file from Content Center and for that you can click on the big I top left (inventor menu) and in the open flyout menu choose Open from Content Center.
The second option is to edit an already generated file or create one by using place from content center in an assembly.
Once you have the part open you can edit and format the parameter display and then you will need to update family template in content center using this new file.

Let’s detail the first option which seems a bit quicker as well. You need to copy the family first and then generate the file because otherwise Inventor will complain that the new template is not a valid file.

- To copy the content center family to a read-write library like My Library provided by default use the Content Center Editor from the Mange tab, Content Center pane and browser to the family.

- Right click the family and copy it to your library.


- Click on big I top left and from the Open fly-out menu choose Open from Content Center, then choose the family you just copied and in the member window make sure you choose Place as Custom. Length and size it's not important so choose any.


- It will then prompt you for a save location and then will open the file for you. Now you can edit the parameters removing trailing, leading, units, and change precision to suit you.


- Now you need to edit Content Center again with the Manage button and then change from Merged View to your library (THIS IS IMPORTANT) or the extra commands will not be available.

- On the contextual right-click menu choose Replace Family Template and select the file you have edited.


So how about all those files generated already?

 Unfortunately you need to open and edit each and every file individually or use code injector and run this code.

Code injector can be found here and the original ilogic code was posted on the autodesk forum by Curtis Waguespack so head over to the original post and give him kudos.


'-------------start of ilogic code ----------------

'get the parameter
oPL = Parameter.Param("G_L")
'export the paramter as an iProperty
oPL.ExposedAsProperty = True
'set the parameter as a custom property
oFormat=oPL.CustomPropertyFormat
'set the custom iProperty as a text type
oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
'set the precision
oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kThreeDecimalPlacesPrecision
'set the unit type
oFormat.Units="mm"
'set to show/not show the unit string (use True to show)
oFormat.ShowUnitsString=False
'set to show/not show the trailing zeros (use True to show)
oFormat.ShowTrailingZeros = False
'set to show/not show the leading zeros (use True to show)
oFormat.ShowLeadingZeros = False

'-------------end of ilogic code ----------------