Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Parameters deg/ul/in

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
warobinson001
3022 Views, 13 Replies

Parameters deg/ul/in

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,

 

13 REPLIES 13
Message 2 of 14
JDMather
in reply to: warobinson001

Yes, divide by 1deg to cancel out units, just like doing it by hand on paper.


-----------------------------------------------------------------------------------------
Autodesk Inventor 2019 Certified Professional
Autodesk AutoCAD 2013 Certified Professional
Certified SolidWorks Professional


Message 3 of 14
warobinson001
in reply to: JDMather

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.

Message 4 of 14
warobinson001
in reply to: JDMather

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.

Message 5 of 14
cwhetten
in reply to: warobinson001

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:

 

Spoiler
BOMWidth = Min(SheetMetal.FlatExtentsWidth, SheetMetal.FlatExtentsLength)
BOMLength = Max(SheetMetal.FlatExtentsWidth, SheetMetal.FlatExtentsLength)
iLogicVb.UpdateWhenDone = True

 

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

Message 6 of 14
rhasell
in reply to: warobinson001

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

Reg
2024.2
Please Accept as a solution / Kudos
Message 7 of 14
warobinson001
in reply to: rhasell

Thanks for all your help.
I copied and pasted your formula into my part and got this message when hitting ok.
Error on Line 2 : End of statement expected.
Message 8 of 14
rhasell
in reply to: warobinson001

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.

 

Reg
2024.2
Please Accept as a solution / Kudos
Message 9 of 14
cwhetten
in reply to: rhasell

Hi Reg,

 

What is your intent with the first two lines? 

 

Capture.PNG

 

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

Message 10 of 14

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!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 11 of 14
cwhetten
in reply to: johnsonshiue

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.

 

Flat extents in iProps.PNG

 

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

Message 12 of 14
rhasell
in reply to: cwhetten

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.)

 

Reg
2024.2
Please Accept as a solution / Kudos
Message 13 of 14
johnsonshiue
in reply to: cwhetten

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!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 14 of 14
warobinson001
in reply to: rhasell

I appreciate your reply. Some coworkers and myself are going to ilogic classes very soon so I hope we can get a good understanding of ilogic.

Sent from my U.S. Cellular® Smartphone

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report