I have a parameter that the units are deg and I am trying to use that parameter in an equation to figure the length of plate. Can I convert that parameter into ul or in so I can use it in my equation.
Thanks,
Solved! Go to Solution.
Yes, divide by 1deg to cancel out units, just like doing it by hand on paper.
I guess I did not convey what I wanted in detail. I was trying to make a user parameter "width" that would export the value to an iproperty "width" but what I was wanting to do in the user parameter is to use a model parameter that happens to be in deg and use that in my user parameter calcs to get a calculated value.
Is there an easier way to get the flat pattern length. Is it stored somwhere that it can be retrieved and used in a parameter or iproperty. I created the model in the formed state with a contour flange and then created a flat pattern.
You created the flat pattern using the sheet metal tools?
It is possible to extract the flat extents to an iProperty by using iLogic. Have you ever used iLogic?
Here is the rule that I use:
I have a couple of user parameters called BOMWidth and BOMLength. I export these parameters to make them into custom iProperties. I also add an event trigger to run this rule when the part geometry changes. That way I know that it updates if the model changes shape.
Cameron Whetten
Inventor 2012
There is a formula to use to isolate parameter types, and use dissimilar units in formulas.
isolate(expr;unit;unit)
Test this iLogic rule
(You need to create the Parameters, Height and Width)
Dim oPartDoc as PartDocument = ThisDoc.Document
Dim userParams As UserParameters = oPartDoc.ComponentDefinition.Parameters.UserParameters
Parameter("HEIGHT")=SheetMetal.FlatExtentsLength
Parameter("WIDTH")=SheetMetal.FlatExtentsWidth
Hi
What version of Inventor are you running?
I suspect the copy and paste was truncated, please see attached text file.
I tested the code in a standalone environment and it worked perfectly?
You need to create an iLogic rule with the code inserted.
Create custom iProperties
"HEIGHT"
"WIDTH"
These can be substituded for you own names when needed.
Hi Reg,
What is your intent with the first two lines?
They don't seem to do anything, since the declared variable userParams isn't used anywhere else in the rule. It should work just fine without the first two lines. If they are deleted, it essentially becomes the same as the rule I posted earlier.
Of course, they aren't hurting anything either, but I am just curious.
Cameron Whetten
Inventor 2012
Hi! I am sorry to click your posting as a solution I am about to provide. Actually, there is indeed a way to reference Flat Pattern Length, Width, and Area in iProperties. Here is what you need to do.
1) Open the sheet metal part.
2) Go to iProperties -> Custom -> enter a property name like "FLAT_WIDTH" or something and set the type to Text -> type in "=<FLAT PATTERN WIDTH>" and hit Enter -> Apply.
You will see the flat pattern width is automatically populated as a custom iProperty. You can do the same for LENGTH and AREA.
Thanks!
Nice one, Johnson. I never knew this was possible.
Unfortunately, this method doesn't give you any formatting options, so you are stuck with however many decimal places it gives you and no units.
This would be more useful if it were possible to import into the user parameters, where we have some formatting options for exporting to a custom iProperty.
Cameron Whetten
Inventor 2012
Cameron
Sorry was out of office.
The code is an extract from a larger set, I accidently left them in. Honestly, I am no guru with iLogic, so if it works I tend to leave things in place until I have time to debug and clean the code up.
I should do that before publishing, but I was under the pump for some drawings, so I posted very quickly.
🙂
(I did not see the code you posted, LOL, it was hiding, yes it was exacly the same.)
Hi! It depends on where you want to display the value. If you are showing it in PartsList in Drawing, the value can be reformatted. For adding it to User Parameters, I suppose you can use iLogic or Inventor API to do that. However, you want to make sure the user parameter is not being referenced by a feature or another dimension driving flat pattern dimensions. It will be a cycle, if you do that.
Thanks!