AutoCAD Inventor :: Parameter To Have Leading And Ending Zeros
Dec 7, 2012
I have a client that wants the part number to be driven by size with a catch.The part number goes like this:
625A3-A01.000M0.500 or 625A3-A10.000M1.000
625A3 = Profile Threaded or unthreaded rod
A= material type A-Mild Steel, B-Ground and polish rod, C-Stainless steel and so on
01.000 is the Length of the part (this is an issue will explain at bottom)
M= thread code K-no tapping, L-10-32 UNC, M-1/4-20 UNC, N- 5/16-18 and so on
.500= Diameter of rod ( nothing bigger than 9 inches)
Ok I have everything working but the Length the issue with this is the leading and trailing zeros and extra..If the length is 1/2 inch the number needs to show as 00.5000 if it is 1 inch needs to show as 01.000 if it was 10 inches it needs to show like 10.000.
Now this is the problem I am having if it is 1/2 I get this 0.500 but I need that extra 0 in the front like 00.500.
I am also having issues when the number is 4 inches or a rounded number 10,9,5 no matter if I have the parameter set to show trailing zeros it seems to work and not work so I get 4 and not 4.000 even in this I would have to get ilogic to add a zero to it like 04.000.
How can I get ilogic to look at the number of characters in the Length and if it is less than the what I need add the others.
I can get the leading zeros in the architectural dim style. My problem is I cant seem to get the leading zero in the parts list format. If I edit the parts list, then format column, there is no option to include leading zeros like in the dim styles.
We could format the parts list with the leading zero before....This is in 2013, BTW..
I'm trying to format a number with leading and trailing zeros. If I only needed trailing zeros I'd set the number as a parameter and force the formating there. I tried using the Format function but it fails and I found one other instance of someone trying it and it failing also.
For example I want to change 2.125 into 02.13
P.S.Just for fun I went to the VBA editor and tried this.
How can I add leading Zeros to the CurrentSheetNumber Field? I know that the code for this field is: %<AcSm Sheet.Number>% . How can I modify this code so that the CurrentSheetNumber is displayed in the form 0001 instead of just 1?
I figured out how to change the precision of the X-Y location dimensions in a hole table, but is there a way to turn off trailing zeros? I have turned them off in my styles, but for some reason the styles don't effect hole tables. Maybe I just don't know where to look?
I have user parameters that are no longer needed and are not being used anywhere. They each takes 4-5 seconds to delete, prior to 2012 this would happen instantly.
I'm detailing a simple square plate with a good number of holes in it. I create an ordiate set running vertically along the LH edge and select the holes that are close to that side. Origin is the lower LH corner. Works great, easy.
The holes that are closer to the RH side though I'd like to show on that side. So I go to create a second ordinate set for the RH side and choose the lower RH corner as the origin and choose my holes that are close to that edge. The 2nd set will automatically show a second "0.000" dimension on the bottom edge and I can't supress it by right clicking.
Is there a better way to do this? What I've done now is to not use a set but just choose ordinate dimension and go from the opposite edge, which works.... But alignment is better with a set.
I got a deadline for my project, but I got a big problem:
"I cannot set the "parameter" for the End Value in Parameter Animate dialog"
For easy understand, let's see a example:
1. I got a part which has two parameters named: "A" and "MaxA" 2. I animate Favorited parameter A. 3. The End Value is MaxA_ (Everything is ok) 4. I finish Studio environment, then I change parameter MaxA_ from 200 mm to 400 mm 5. I turn back to Studio environment, the End Value now is "200 mm" (I want this will be MaxA_, so I can animate the flexible parameter).
show me how to keep the end value will be "MaxA_" after I change parameter?
I am trying to publish to the CC a guide rail. The vendor of the rail gives me the option of entering the desired length of the rail. After that he gives me the option to choose between the length that I entered and a shorter and longer standard length witch can be delivered faster.
I want to do the same thing with my published part, but I cannot make a key parameter to change depending on the entered custom parameter. I want the user to make the next steps when inserting from the CC: 1- select the size of the rail; 2-select the type of the rail; 3- enter the desired length of the rail; 4- choose between the desired length and the 2 recommended lengths (I need these 3 lengths to be shown)
If I use a linear dimension, and the value works out to something like 4'-1/2", Autocad will display 4'-01/2".
This is the documented behavior per autocad documentation:
Link to Documentation
"If feet are included with a fractional inch, the number of inches is indicated as zero, no matter which option you select. Thus, the dimension 4'-3/4" becomes 4'-0 3/4"."
It is also an extraordinarily silly behavior. How can I force my dims to display 4'-1/2" other than exploding them and editing by hand? ( or by using the "text override" feature )
We've created our own door tags. Now in ACA 2013 the doors that have sizes that end in zero (like 3'-0") are showing a zero, a decimal and three trailing zeros in the zero value.
They are read-only, so seem to reflect the start and end of the profile tangents.Would you ever not set those to the alignment start and end stations?
I tried setting them to stations before and after the alignment start and end stations, that did not allow me to reach my goal of allowing addition of PVI's before alignment start and after end.
I know you can have the profile extend beyond the alignment, it works fine if you add the PVI's with the C3D toolbar.I can't figure out how to do it with the API though.
I'm trying to suppress trailing zeros in a surface slope label in run:rise format. Basically, if it's a 2 to 1 slope, I want it to read 2:1 or if it's a 2.5 to 1 to read as 2.5:1.
I found this blog showing how to do it for line slopes, but I think it's not able to work using the run:rise format.
I've read through some of the discussions on this subject. I have three lines of command visible. I blocked out my file. I audited my file. I have Service Pack 1.1 installed. I still continue to have intermittent problems with the area command. Please see in the attached video how it works in one area of my file, but not another area of the same file. URL....
I have a routine that runs a cycle through 36 large dynamic blocks, then finishes. Somewhere in this code I'm either leaking memory, running a never ending loop, or AutoCAD gets stuck on something. I have a 12gb machine, and this file only uses a few MB on the hard drive. So even after I save and close the file, AutoCAD is using 100% of 1 core CPU (4 core i7) in 0 drawing state stuck at 11gb of Memory (Private Working Set). So, What is this program doing in 0 drawing state, and how is my code responsible? I have to kill it with task manager.
<CommandMethod("SetCurveOffset")> _ Public Shared Sub SetCurveOffset() Try Dim doc As Document = AApplication.DocumentManager.MdiActiveDocument Dim db As Database = doc.Database Using lock As DocumentLock = doc.LockDocument() Using trans As Transaction = db.TransactionManager.StartTransaction Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForRead) Dim btrModelSpace As BlockTableRecord = trans.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite) Dim curves As New List(Of [code]..........
in Inventor 2010 we can save and load iLogic Paremeter with *.xml and just in my opinion we can control parameter using *xml or html. It's right or false?
I need to extrude a simple shape between two planes and then get the length as a parameter. Is there anyway of generating this? All I can find is a parameter for the angle of the extrusion.
I have generated frame that has 100 members in it. Is there a quicker way of changing G_L unit to a mm so that I don't have to go into all 100 parts to change the custom properties?
Also I do not need unit string to be appear in my BOM.
I set a dimension to a 2dline. The dimension is automatically added to Model Parameters. How can I find , by code, the line which length is driven by the parameter ? Or, starting from the line find the parameter which indicate its length ?
::GetDependents(), nor ::GetDrivenBy(), nor ::GetParent() gives me the answer.
I'm trying to get a parameter value from an Inventor .dwg file, but I keep getting an error saying the file is not found. I use this same code all over the place between different parts but its the first time I'm tried it using a dwg. Can you not access an Inventor .dwg parameters using iLogic .
Sometimes I change the dimensions of a material I use but then I have to open Iproperties and change the description by hand. This can create problems as you can understand especially when I forget to update the Iproperties.
Then I had the thought to automate it. Lets take a steel bar as example. I have thickness and width as parameter, both are exported and available under IProperties/Custom. But they show as 200 mm and 10 mm. I would like to loose the units. I tried also UL but then it reads 200 ul and 10 ul.
What I like to get are just the numbers, no units. I like to use it to create this "steel bar 200x10" where the 200 and the 10 are linked to the Parameter and will change when I change the dimensions av the steel bar.
Is there a way to use the filename to drive the parameters of the file?
Example: I have a cube that is called 4x4x4.ipt its dimensions d0,d1,d2 are 4,4,4 respectively. I want to rename it to 4x4x6.ipt and have the dimensions d0,d1,d2 resize to 4,4,6.
System variable to keep a stacked fraction with the leading number?
We open the same drawing on different computers at work and on one computer the number will be 21/2 but on the next computer that opens the same dwg the 1/2 will have been bumped down to the the following line. I don't know if this is a problem with the autostack properties, although I can't find anything about that, or if its a problem with the tabs.
I'm completely at a loss and its becoming a problem because if one person opens a project to plot it and it looks fine but the next person opens it and every mtext in the dwg is wrong it becomes very time consuming to fix.