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: 

iLogic show equation instead of value

12 REPLIES 12
Reply
Message 1 of 13
CadUser46
1571 Views, 12 Replies

iLogic show equation instead of value

We have some equations in our templates which i have modified with iLogic. Once the rule is run it only shows the value and not the equation. ie i want it to show Thickness*2 instead of just '12'. The ilogic will say something like InnerRad = Thickness * 2 Is there a way to make it show the equation rather than the value? While i know whats going and can see the driven link in the parameters the planned change to 2012 could take some getting used to for users.

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
12 REPLIES 12
Message 2 of 13

Hi CadUser46,

 

This will toggle all of the sketch dims in the part to dislay the equation:

 

ThisApplication.CommandManager.ControlDefinitions.Item("DimensionDisplayEqn").Execute

 

or you could use something such as this to toggle between Value and Expression:

 

 

  kDimensionDisplayAsValue = 34817
  kDimensionDisplayAsName = 34818
  kDimensionDisplayAsExpression = 34819
  kDimensionDisplayAsTolerance = 34820
  kDimensionDisplayAsPreciseValue = 34821
  
Dim oDoc As Inventor.PartDocument
oDoc = ThisApplication.ActiveDocument

Dim oParams As Parameters
oParams = oDoc.ComponentDefinition.Parameters

Dim oModelParams As ModelParameters
 oModelParams = oParams.ModelParameters
  

If oParams.DimensionDisplayType = kDimensionDisplayAsValue then
oParams.DimensionDisplayType = kDimensionDisplayAsExpression
else
oParams.DimensionDisplayType = kDimensionDisplayAsValue
end if

 

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

Message 3 of 13

Thanks Curtis i will have a play with that at some point.  I take it this means there is no way to show the expression in the parameters then?  Kind of like writing the expression to the parameters rather than computing the value?


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 4 of 13

Hi CadUser46,

Sorry I misunderstood what you were after. Actually, I think there is a way to do that, but I can't recall where the setting is off the top of my head. Unfortunatly, I just tied my computer/Inventor up for a long task, so someone else might jump in here and point you to it. I'll try and look it up in the mean time.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 5 of 13

Hi CadUser46,

 

Okay, I think this is what you're after. Below is a snippet  that toggles this setting between Value and Expression.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Autodesk Inventor iLogic Dimension Display.png

 

 

Dim oDoc As Inventor.PartDocument
oDoc = ThisApplication.ActiveDocument

Dim oParams As Parameters
oParams = oDoc.ComponentDefinition.Parameters

Dim oModelParams As ModelParameters
 oModelParams = oParams.ModelParameters
  
If oParams.DisplayParameterAsExpression = True  then
oParams.DisplayParameterAsExpression = False

Else if DisplayParameterAsExpression = False Then
oParams.DisplayParameterAsExpression = True
end if

 

Message 6 of 13
CadUser46
in reply to: CadUser46

Hi Curtis.  Its close but still not what i was after.  I have screen printed what im after.

 

Thanks


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 7 of 13
MjDeck
in reply to: CadUser46

You have to maintain the equation as a text string in the rule.  Here's a sample:

trigger = Thickness
Parameter("d5") = "Thickness / 2"

The trigger line is required to make sure the rule will run when the value of Thickness is changed.  If you are using Thickness elsewhere in the same rule (not in a text string, but as a variable that shows up in blue) then you don't need the trigger line.

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 8 of 13
CadUser46
in reply to: MjDeck

Cheers Mike.  I did try something like that but i was using the wrong notation.  I will adjust tomorrow.

 

Thanks.


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 9 of 13
CadUser46
in reply to: CadUser46

OK so got around to trying this today.   It works as long as the parameter has its default value.  If it has been renamed it does not work and i just get an error.

 

If i write something like this i get an error;

Parameter("InnerRad") = "THICKNESS"
Parameter(InnerRad) = "THICKNESS"

 

If i write something like this iit works fine;

Parameter("d5") = "THICKNESS"

 

If i rename i parameter back to its default after having already changed the name it no longer works either.


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 10 of 13
MjDeck
in reply to: CadUser46

I'm not sure what is causing the problem.  Can you post another screenshot of your Parameters dialog, showing both parameters?  Or can you post the part or assembly?


Mike Deck
Software Developer
Autodesk, Inc.

Message 11 of 13
CadUser46
in reply to: MjDeck

Hi Mike

 

I have attached a file.  You will see from the ilogic the parameters InnerRad and OuterRad which should be written as expressions in both of the rules.


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 12 of 13
MjDeck
in reply to: CadUser46

Here's a version of your part with the rules edited to set the Equations for InnerRad and OuterRad with statements like this:

Parameter("InnerRad") = "Thickness * 1.5 ul"

Note that when you use statements like that, with parameter names in text strings, the parameter names will not automatically change in the rule if you rename the parameter in the part.  You have to edit the rule and do a Search and Replace to replace the old parameter name with the new one.


Mike Deck
Software Developer
Autodesk, Inc.

Message 13 of 13
CadUser46
in reply to: MjDeck

Mike.  Thanks for the help.  I have it working now but could have sworn blind i already used that exact syntax.

 

I understand the ilogic would not change automatically but i wonder if it makes a difference if i simply typed in the text window rather than double clicking to insert the model paramter.

 

Thanks again.


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro

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

Post to forums  

Autodesk Design & Make Report