AutoCAD Inventor :: Setting Decimal Precision For Text Derived From Number
Jul 14, 2012
I'm using ilogic to automatically build standardized descriptions that are linked to a field in our PDM system for future searches. The problem is that the variable "Length" (shown below) can sometimes be a whole number so it drops the trailing zeros and I want it to always be a two decimal value.
Formula:
iProperties.Value("Custom", "2ND_SUBTITLE")=CStr(ID)+" ID x "+CStr(OD)+" OD "+CStr(Round(Length, 2))+" LG"
I have a couple of strange angles and moving parts going on in an assembly. there is 1 constraint i am happy for inventor to predict the offset for. the problem is I am using other constraints i later want to bin, to pin it in position then try to apply this constraint. it looks like the predict offset tick box only measures to 3 dp, so as soon as i apply this constraint my model goes sick. I have to take a measurment and copy and place the measurment with all dp's into the constraint to make it work.
Is there a setting to specify the predict offset number of decimal places?
I have had a problem with retrieved dimensions decimal precision. I set the precision to 1 decimal place in the ipt but when I retrive the dimension it set the precision to 3 decimal places. I then go to the precision control in the drawing and change it to 1 decimal place.
If I then go back to the ipt and edit the dim, the drawing precision then jumps back to 3 decimal places. (This is particular to the decimal precision for the tolerance of a dimension). How to sort this out?
I wanted to select dimensions and change the precision to 2 decimal points.
For any dimensions I positioned on the object (like the width of the block centered in the block)...rather than above, below or off to the side. I am unable to select that dimension. Every time my cursor goes towards the dimension to select it.....the block itself is automatically selected. Any dimension outside the boundary of the object is fully selectable to edit.
I've got a sketch in a part that I want to derive into its own part and place in an assembly. I can do that no problem, but the text on the sketch is just empty boxes. Is there any way to bring the text through to the derived part?
The text is orientation information that I want in both the part and the assembly, not for permanent display but just to hover and display or switch on when needed. Maybe there's a better way of doing it if what I'm asking for is impossible.
How to change the number of decimal places of the elevation of points?
as the points are labeled with their elevations, I couldn’t find how the number of the decimal places of the elevation be chosen. In this case, I wanted to let the number of the decimal places to be zero.
How to set the number of the decimal places to be zero or 1, for example? how to sepcify it height (size)?
I have a number like 4534.3245 If I say 4534.3245 as Integer I get 4534 thats fine.
Is there an easy way in maxscript to return the number after the decimal only no matter what it is? like saying: 4534.3245 as fraction returns .3245?
With the numbers I am dealing with the integer part could be any size and fraction decimal section could be any size so I am hoping for a general rule or method for getting that after decimal number.
when I try things like formattedprint there is a rounding off happening changing it to .3245 to .3247 and more digits added etc but I dont want all that because it is changing the value of the number before I have even done anything with it. Maybe their is a formattedprint method but I am not seeing it.
The defaul label style for the Elevation of points is set to 3 decimal places. We are trying to change the elevation display to 2 decimal places. We have tried the directions in the following discussion: [URL].......
Which is:
Toolspace
->Settings -->Drawing name --->Edit Drawing Settings ---->Ambient Settings ----->Elevation ------>Precision -> We modify from 3 to 2 decimal places.
It does not modify the display settings.
Also:
Toolspace
->Settings -->Drawing --->Point ---->Label Styles ----->(right-click) Edit label styles ------>Layout ------->Text -------->Contents --------->click on the "..." (three points) button
(Open "Text Component Editor - Contents"
--------->Select Point Elevation in the driop down list. ---------->Precision: Set to 0.01 ------------>Ok, Apply, etc...
I work with ANGTOS and ANGTOF quite a bit. I'm working with latitude and longitude conversions in MAP 3D for an application where accuracy is top priority. Most of the time ANGTOS (and RTOS, for that matter) return an accurate result for the number if decimal places requested, but then I run into a situation like this:
Im linking a prompted entry in a sketch symbol to a selection from the user in an array. The code works perfectly.
The array displays the number of sheets there are in the document, the user selects the correct one & the sheet number is displayed in the prompted entry. I need to add "SHT" before the number though in the code but I cant get it to work.
I dont want to add a text line into the symbol saying "sht"
Dim oApp As Application: oApp = ThisApplication Dim oDoc As DrawingDocument: oDoc = oApp.ActiveDocument Dim oSheet As Sheet: oSheet = oDoc.ActiveSheet
'This uses a sketch symbol with the name "'View On' View Label" Dim oSymDef As SketchedSymbolDefinition: oSymDef = oDoc.SketchedSymbolDefinitions.Item("'View On' View Label")
'This is the selected view Dim oView As DrawingView: oView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter,"Select View To Place Symbol:")
'This takes the label items of the selected view 'And adds it To an array that will link To the prompted entry Dim sPromptStrings(2) As String sPromptStrings(0) = oView.Name sPromptStrings(1) = oView.ScaleString
oDoc = ThisApplication.ActiveDocument
Dim sSheet As Sheet
'create sheet number list Dim oSheetList As New ArrayList i = 0 s = "-" For Each sSheet In oDoc.Sheets i = i +1 oSheetList.add(i) Next oSheetList.add(s)
'get user input mySheet = (InputListBox("View taken form sheet number.", oSheetList, oSheetList(0), "Sheet Number Ref.", "Sheet Numbers"))
sPromptStrings(2) = mySheet
'This is the position for the sketched symbol under the selected view' Dim oPosition As Point2d: oPosition = oView.Center oPosition.y = oPosition.y - (oView.Height / 2 + 2.5)
'This inserts the sketched symbol and fills in the prompted entry. Dim oSymbol As SketchedSymbol: oSymbol = oSheet.SketchedSymbols.Add(oSymDef, oPosition, , ,sPromptStrings)
I have a custom iProperty with a text value of "Plate, Steel 140 mm". Is it possible to strip out the 140 (text) from the string and convert it to a number?
I would really like to put some text in the part that links to the iproperties so I can emboss the stock number on the parts. It never fails that you create a new part, then forget to change the text. This would save a ton of time and re-plots.
In Autocad 2014 I can't seem to get the same properties when I choose a dimension as I have been with all previous vertions. It does not have any of the option such as text height, Tolerance, Precision etc. Is this new for 14?
I'm using the "Part Number" parameter inside a block of text in my drawing, but when I export it to AutoCAD DXF 2010 format, the text in the exported file shows up as "<PART NUMBER>", instead of displaying the actual part number.
I am using ilogic in Inventor 2011 to update my iproperties when I save a .dwg file. I am having problems with some custom iProperties I have created that are of the type 'number' and are initially set to 0 (zero). After the iLogic rule has run and the user has entered a numeric value the type of the custom iproperty has changed to 'text'.
The ilogic code I am using is:
If iProperties.Value("Custom", "Nominal ID") = 0 Then iProperties.Value("Custom", "Nominal ID") = InputBox("Enter The Nominal ID (Enter 0 if no value is available)", "Nominal ID", 0) Custom_iProp_Nom_ID = iProperties.Value("Custom", "Nominal ID") End If
I am using Vault 2011 and would like to map this property to a numeric property so I can perform <= and >= searches.
I had wanted to find a way to engrave/emboss the part number on a part model and have it be parametrically tied to the part number iProperty. Since it doesn't appear that I can create a text box and insert the iProperty directly, here's what I did to work around this. (I setup my part templates to have this out of the box....)
1. Within, the IPT file, add a user text parameter called "PartNo" and set its initial value to any text value.
2. Create your sketch for your text to be engraved. Insert the User parameter you just created.
3. Create the engraving/embossing for your text.
4. Create the following iLogic rule:
' Requires a User Text Parameter called "PartNo" prior to running' Set the appropriate event trigger to tasteIf Parameter("PartNo") <> iProperties.Value("Project", "Part Number") ThenParameter("PartNo") = iProperties.Value("Project", "Part Number")InventorVb.DocumentUpdate()End If
5. I set this rule to fire using the "iProperty Change" event trigger. So if the iProperty is set or changed, your text will update. Obviously, you can set this to run with whatever trigger you like.
I have created a form in which I need to see the volume value. For that I created a User Parameter that is set to be equal with part's volume:
Volume=iProperties.Volume
What I don't like is that the precision for the parameter is too long and I can't change it. I changed the precision in Document Settings and also for the parameter itself in the Parameters window, but these changed don't affect what is the form.
How to set display of precision in my parts list to just one digit?
When I edit parts list set up im styles editor or edit parts list and go format column, apply units formatiing and set columns for one unit type and precision, then I get an error about units being incompatible because some items I have listed as each some by lf.
How to change precision in one column of parts list and keep unchanged unit formatting?
I've recently been playing with the "Retrieve Dimension" feature in IDWs to pull the model dimensions and tolerances from the IPT. I'm wondering if I am understanding the behavior correctly.
The IPT Document Settings > Default Tolerance "Use" and "Export" standard tolerance values boxes are checked.
I have standard tolerances defined for .xx and .xxx precisions. Default in the IPT is .xxx.
If I place a sketch dimension and extrude a feature, place that part in an IDW, and "Retrieve Dimension," the result is that the dimension's precision and tolerance are defined by the active IDW style.
However, if I place the sketch dimension, and then modify its precision to be something other than the IPT default, when I "Retrieve Dimension" in the IDW, it pulls the modified precision and tolerance from the IPT settings.
Is this the expected behavior? When I see the box in the IPT Default Tolerance tab that says "Export Standard Tolerance Values," I understand that to mean that the standard tolerance values in the IPT will be propagated to the IDW. Is this incorrect?
I am working on updating my Parts List and ran into a little issue. When I make a Parts List with components from the content center, in this case some angle, I cannot get the correct precision.
See attachment.
The first picture shows the correct units in the QTY column but I would like the 2.000ft to just be 2ft. If I modify the style to correct the precision it adds the units to every item in the QTY column as you can see in the second picture.
Is there a way around this without editing the Parts List each time I create one?
All the values I put in to set my tolerance are being rounded to three decimal places even though the value is four place and I am setting the dimension precision to four place.
For Example: I have a hole of diameter 2.0466. It is to have a tolerance of +.0005/-.0000. When tolerance.setToDeviation is called, the .0005 is strangely forced to .001 and is set as this in the part file. The precision value had already been set to 4 at this point.
I am using the following code in Inventor 2010:
'Create hole feature Call oCompDef.Features.HoleFeatures.AddDrilledByThroughAllExtent(oLinearPlacementDef, dDiameter, kExtentDirection) 'Get hole feature just created Dim oHole As HoleFeature Set oHole = oCompDef.Features.HoleFeatures.Item(oCompDef.Features.HoleFeatures.Count) ' need most recent index
When referring to flat pattern length and width you can make an custom iproperty and add =<Sheet Metal Width>. You can then add 2 fields in the drawing parts list and set precision, trailing zeroes and unit string on/off.
Most companies have 1 field for 'Size' or put size inside description and then you cannot format
The problem is that if you fill in description: =Sheet <Thickness>mm, <Sheet Metal Width>x<Sheet Metal Length> you get the following:
Description: Sheet 15mm, 3411,978 mm x 2000,000 mm
i Want to have Description: Sheet 15mm, 3412x2000
You can't change property format as you can with user parameters you set to export as far as I know. Is there a way? excluding iLogic, which would only be a half baked solution. I would really like to have width and length as a sheet metal parameter, rather than a iproperties formula.
How can I change the precision of Driven Dimensions. I have a Driven Dimesion in a sketch that I want to use in another dimension later. Let's say that d59 is a Driven Dimension.I want dimension d80 = d59*2. When I measure it using eight decimal places, I can see that it is rounding d59 to 3 decimal places, but I don't want it to do that because then d80 is off.
Is there a way to set the decimal place for the columns in Autodesk Inventor 2011? I have a length column I am trying to use for the p/n but I need it to be 2 places and they show up from zero to 4 dec places. I have set it inside excel but it never retains the setting.