Hi all. I'm using Inventor 2017, trying to make a custom iProperty for Price for use in a Bill of Materials. I would like to be able to calculate the price based on the weight and our data for price / pound of material. Is this possible?
A couple of problems I've run into:
I've made a custom BOM iProperty column, but when I use the <Mass> iProperty it shows me the mass in grams rather than lbmass. Is it possible to change the unit type or will I just have to include a conversion factor into the formula?
The bigger problem is I can't do anything to the <Mass> property once it's in the expression dialog. Typing in "=<Mass> x 2" or "=<Mass> * 2" both simply report the same number as <Mass>. What am I doing wrong here?
Thanks in advance. I'm willing to use iLogic if I have to, but I wanted to keep everything within the BOM. I'm open to other ways of automatically calculating price based on weight.
Solved! Go to Solution.
Hi all. I'm using Inventor 2017, trying to make a custom iProperty for Price for use in a Bill of Materials. I would like to be able to calculate the price based on the weight and our data for price / pound of material. Is this possible?
A couple of problems I've run into:
I've made a custom BOM iProperty column, but when I use the <Mass> iProperty it shows me the mass in grams rather than lbmass. Is it possible to change the unit type or will I just have to include a conversion factor into the formula?
The bigger problem is I can't do anything to the <Mass> property once it's in the expression dialog. Typing in "=<Mass> x 2" or "=<Mass> * 2" both simply report the same number as <Mass>. What am I doing wrong here?
Thanks in advance. I'm willing to use iLogic if I have to, but I wanted to keep everything within the BOM. I'm open to other ways of automatically calculating price based on weight.
Solved! Go to Solution.
Solved by jtylerbc. Go to Solution.
Mass showing in the wrong units is due to a setting that is incorrect in either your specific file or your templates, or possibly both. With the file open, go to Tools, Document Settings, and click on the Units tab. There you will be able to change the units for Mass from grams to lbmass.
For the math, you will likely have to use iLogic. Although I don't use it much anymore, I have done essentially the same thing you are trying to do. My code is below.
If CostByWeightRun = "True" Then mass = iProperties.Mass TotalCost = Costlb * mass iProperties.Value("Project", "Estimated Cost") = TotalCost ElseIf CostByWeightRun = "False" Then End If
My code uses a True/False parameter as a switch for whether or not to calculate the cost. If you don't need that on/off functionality, you can strip the If/Then conditions out of the code and streamline it.
"Costlb" is a unitless User Parameter that allows you to enter the cost per pound in an iLogic form that pops up on initial creation of the part.
Mass showing in the wrong units is due to a setting that is incorrect in either your specific file or your templates, or possibly both. With the file open, go to Tools, Document Settings, and click on the Units tab. There you will be able to change the units for Mass from grams to lbmass.
For the math, you will likely have to use iLogic. Although I don't use it much anymore, I have done essentially the same thing you are trying to do. My code is below.
If CostByWeightRun = "True" Then mass = iProperties.Mass TotalCost = Costlb * mass iProperties.Value("Project", "Estimated Cost") = TotalCost ElseIf CostByWeightRun = "False" Then End If
My code uses a True/False parameter as a switch for whether or not to calculate the cost. If you don't need that on/off functionality, you can strip the If/Then conditions out of the code and streamline it.
"Costlb" is a unitless User Parameter that allows you to enter the cost per pound in an iLogic form that pops up on initial creation of the part.
Look into the iLogic Code Injector.
May still take some time to process, but you can spend at least some of it at the coffee machine instead of sitting at your desk copying and pasting the same code hundreds of times.
Look into the iLogic Code Injector.
May still take some time to process, but you can spend at least some of it at the coffee machine instead of sitting at your desk copying and pasting the same code hundreds of times.
Thanx for the code, Tyler.
This will do it for me, except I was hoping to use 'out of the box' functionality.
I too created a custom iProperty 'price_per_sq_in", but can't get it into the 'Estimated Cost' iProperty b/c there's no way to make a formula in it. Guess I'm once again STUCK using iLogic, right?
Thanx for the code, Tyler.
This will do it for me, except I was hoping to use 'out of the box' functionality.
I too created a custom iProperty 'price_per_sq_in", but can't get it into the 'Estimated Cost' iProperty b/c there's no way to make a formula in it. Guess I'm once again STUCK using iLogic, right?
Yes. My setup for this has been established for quite a while (and as I mentioned earlier in the thread, is now used infrequently anyway). So my memory on this is slightly rusty. But I believe there are two issues that complicate it and make iLogic necessary:
As far as I am aware, the Estimated Cost property is the only one where the #2 issue exists.
Yes. My setup for this has been established for quite a while (and as I mentioned earlier in the thread, is now used infrequently anyway). So my memory on this is slightly rusty. But I believe there are two issues that complicate it and make iLogic necessary:
As far as I am aware, the Estimated Cost property is the only one where the #2 issue exists.
Thanx John.
That's exactly what I discovered.
I want to show a '$' sign at the beginning of the number in the BOM, b/c that's what people need to see.
But there isn't a 'Currency' prefix available in the Parameters dialogue.
Nor is there any way to do calculations w/currency in Inventor like you can in Excel.
So basically I'm forced to use 'Estimated Cost' + iLogic.
I based my rule on your rule.
I HATE coding, b/c if you make one little error, it won't run. And if you fail to know everything that can foul up a piece of code, then you will waste endless hours hunting down the cause...and most of the time it's NOT worth it. For example: My rule based on your rule runs when I RMB>Run. But it won't run at triggered before Saving. Why? Well, I just figured it out. But it took me 2 HOURS. Who knows when I'll need this functionality again?
Anyway, thanx for helping!
Thanx John.
That's exactly what I discovered.
I want to show a '$' sign at the beginning of the number in the BOM, b/c that's what people need to see.
But there isn't a 'Currency' prefix available in the Parameters dialogue.
Nor is there any way to do calculations w/currency in Inventor like you can in Excel.
So basically I'm forced to use 'Estimated Cost' + iLogic.
I based my rule on your rule.
I HATE coding, b/c if you make one little error, it won't run. And if you fail to know everything that can foul up a piece of code, then you will waste endless hours hunting down the cause...and most of the time it's NOT worth it. For example: My rule based on your rule runs when I RMB>Run. But it won't run at triggered before Saving. Why? Well, I just figured it out. But it took me 2 HOURS. Who knows when I'll need this functionality again?
Anyway, thanx for helping!
Hi Folks,
I guess another way is to treat the cost as unitless value. Then at the column header, attach the dollar sign.
Many thanks!
Hi Folks,
I guess another way is to treat the cost as unitless value. Then at the column header, attach the dollar sign.
Many thanks!
Yes, but that defeats the purpose of having the native Inventor "Estimated Cost" iProperty.
What good is it if it doesn't work like all the iProperties you can use Parameters in?
I just saw a similar problem with the Temperatures Parameter the other day on this forum.
All these years, and still no simple Excel functionality in these not so frequently used Parameters and iProperties.
I recall many years ago I wanted to use my BOM as a cost estimator for all my projects.
But b/c of the limitations I'm being reminded of, I quit trying back then.
We were forced to resort to sending an exported BOM (Excel) to the estimators so they could manually work up a quote on parts and materials. I have to ask WHY waste coding on an iProperty that's useless??
Yes, but that defeats the purpose of having the native Inventor "Estimated Cost" iProperty.
What good is it if it doesn't work like all the iProperties you can use Parameters in?
I just saw a similar problem with the Temperatures Parameter the other day on this forum.
All these years, and still no simple Excel functionality in these not so frequently used Parameters and iProperties.
I recall many years ago I wanted to use my BOM as a cost estimator for all my projects.
But b/c of the limitations I'm being reminded of, I quit trying back then.
We were forced to resort to sending an exported BOM (Excel) to the estimators so they could manually work up a quote on parts and materials. I have to ask WHY waste coding on an iProperty that's useless??
Can't find what you're looking for? Ask the community or share your knowledge.