So I have created a custom template for W-Beam creation and I've been able to get iLogic to generate the description for me, "almost", in the format I need, but the LENGTH is just showing up as a number, when it needs to be to (2) decimal places and show trailing zeros.
example: BEAM, W6X9, (34.00" LONG)
what iLogic is giving me: BEAM, W6X9, (34 LONG)
below is some info to help me figure out what I need to do. I've tryed rounding, but either I'm doing it wrong or it's not working for this example.
Any help would be great as I can't rool out this template until the description is fixed.
Chris
Can you post the code you have the pictures you posted are not there so I can't help if I can't see what you have..
Yes, I will post the code in the morning.... it's driving me crazy. I've trying rounding, I've tried decimal place rules, I've tried linking the pram to a custom property and rounding that, I must be missing something....ahhhh.....
iProperties.Value("Project", "Description")="BEAM, " & Choose_Size & ", " & "(" & LENGTH & " LONG)"
To have something that will obey your document unit settings including the units they are set to. Not this will include the units.
uom = ThisDoc.Document.UnitsOfMeasure
p_len = uom.GetStringFromValue(Parameter.Param("LENGTH").Value, uom.LengthUnits)
iProperties.Value("Project", "Description")="BEAM, " & Choose_Size & ", " & "(" & p_len & " LONG)"
I already emailed it to Chris, but here's code to do this.
olength = Parameter.Param("Length") olength.ExposedAsProperty = True oFormat=olength.CustomPropertyFormat oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kTwoDecimalPlacesPrecision oFormat.Units="in" iProperties.Value("Project", "Description") = "=<Length>"
It's modified from code that Curtis_Waguespack posted in this thread.
The code Donovan provided successfully creates a length with 2 decimal places, but it strips out all the other info from the description. I tried combining his code with the original description code but it didn't seem to work together, so I'm still at square 1..??
I did confirm that if the dimension is 34.125 it displays the length with 3 decimlas, but for some reason it is not letting me keep trailing zeros..
This is the way I have mine set up.
I don't use the Length Parameter in a sense.
Make a user parameter as "text" called L_1 or what ever you wish just not Length keep length for user input only
At the top of your ilogic code put this in
iLogicOption DoubleForEquals Off L_1 = Format(LENGTH, "00.000")
you can change the "00.000" to "000.0000" or "00.00" the zeros are how many places it will format.
then change your ilogic callout to
iProperties.Value("Project", "Description")="BEAM, " & Choose_Size & ", " & "(" & L_1 & " LONG)"
Also make sure your length Fx is set to export..
Oh if you don't want leading zeros make it ".000" so you only get trailing zeros I need leading also so that is why I have it that way..