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: 

Unfold Rule: Reporting Value From Custom Equation

1 REPLY 1
Reply
Message 1 of 2
JPrune
402 Views, 1 Reply

Unfold Rule: Reporting Value From Custom Equation

So, I currently have an unfold rule that works for all the different kinds of angles I could ask for, however, I would like the value of that Custom Equation to be reported to Parameters or on my drawing.  Is there anyway I can get Inventor to report that value through iLogic or something similar to that?

1 REPLY 1
Message 2 of 2
MjDeck
in reply to: JPrune

Here's an iLogic rule that will get the last (or the first if there is only one) equation of the active unfold method.  It will assign the equation to a custom iProperty named UnfoldEquation.  You have to create this iProperty before adding the rule.  Note that if you have more than one equation, you might need more properties.  You can use the iProperty in the drawing.  I don't know if the equation will be in the format you want for the drawing.

I tested this in Inventor 2011.  It should also work in 2012.

Dim partDoc as PartDocument = ThisDoc.Document
Dim sheetMetalCompDef As SheetMetalComponentDefinition = partDoc.ComponentDefinition

Dim oUnfoldMethod As UnfoldMethod  = sheetMetalCompDef.UnfoldMethod

Trace.WriteLine ("Unfold Method:  " & oUnfoldMethod.Name)
Trace.WriteLine ("     In Use: " & oUnfoldMethod.InUse)
Trace.WriteLine ("     Up to Date: " & oUnfoldMethod.UpToDate)

If (oUnfoldMethod.UnfoldMethodType = UnfoldMethodTypeEnum.kCustomEquationUnfoldMethod) Then
Trace.WriteLine ("     Unfold Method Type is Custom Equation")
For i As Integer = 1 To oUnfoldMethod.EquationCount
  Dim equation As String
  Dim minimumValue As String
  Dim minimumCompareCondition As ComparisonTypeEnum
  Dim boundedVariable As String
  Dim maximumValue As String
  Dim maximumCompareCondition As ComparisonTypeEnum
  oUnfoldMethod.GetEquation(i, equation, minimumValue, minimumCompareCondition, boundedVariable, maximumValue, maximumCompareCondition)
  Trace.WriteLine ("  Equation: " & equation)
  iProperties.Value("Custom", "UnfoldEquation") = equation
Next 
Else
MessageBox.Show(" The active unfold method is not a Custom Equation.", "Sheet Metal")
End If

 


Mike Deck
Software Developer
Autodesk, Inc.

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

Post to forums  

Autodesk Design & Make Report