- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a client that wants the part number to be driven by size with a catch.
Hope I can explain it for all to understand. I have it some what working but need some guidance.
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.
Hope I explained it for all to understand. If not ask away and I will try to expain more.
Here is what I have been trying but I am failing.
If LENGTH >= Len(5) Then
Parameter("L_1") = "0" & LENGTH & ".000"
Else
Parameter("L_1") = LENGTH
End If
iProperties.Value("Project", "Part Number")= "625A3-" & Mat_Code & L_1 & Tap_Code & Rod
Solved! Go to Solution.

