Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calculate a value from one or the other depending on the changed parameter

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
gert-leonvanlier
411 Views, 6 Replies

Calculate a value from one or the other depending on the changed parameter

Is it possble to calcalute a parameter from another parameter and vice versa? S one parameter is changed, the other adapts.

 

For example I have

ConnectorHeightIn = HeightIn - 44

HeightIn = ConnectorHeightIn + 44

At this point I can not calculate HeightIn from ConnectorHeightIn.  The calculation has to work both ways.

6 REPLIES 6
Message 2 of 7

With VBA; Vb.net or Ilogic?

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 3 of 7

Preferably with iLogic, but if that is not possbile the next best/easiest thing.

Message 4 of 7

Maybe I should at the reason I want this.

 

We are creating assets for the Factory Design Suite. The user should enter HeightIn and HeightOut of asset 1. The user then connects assset 2 to asset 1. In the background ConnectorHeightIn and ConnectorHeightOut are calculated based on the type of asset, angle and so on. Using connectorclasses we synchronize ConnectorHeightOut and ConnectorHeightIn. From there on HeightIn of asset 2 should be calculated.

 

The user should only have to alter HeightIn or HeightOut, ConnectorHeightIn and ConnectorHeightOut are calculated within the asset and will then drive the other parameter.

 

I hope this makes sense.

Message 5 of 7

you could make 2 iLogic rules.

The first to set 'ConnectorHeightIn':

 

Parameter("ConnectorHeightIn") = HeightIn - 44

The second to set 'HeightIn':

 

 

Parameter("HeightIn") = ConnectorHeightIn + 44

 

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 6 of 7

Great! Thank you very much, that works.

 

Is that because of the two seperate rules or because of adding Parameter(".....")? What is the use of this instead of direct calling the parameter by its name?

Message 7 of 7

The problem is that you cant see wich paramter is updated if you put all calculations in 1 rule. the trick here is that i want to trigger 1 rule only when 1 parameter is updated. if you "get" or "set" a parameter directly it will act as a trigger for that rule. (you can reconise triggers in a rule because the get blue in the code.) Therfore if you "get" 1 parameter directly and "set" the other directly you will have 2 triggers. That is not what i wanted. By setting 1 parameter indirectly ("Parameter(...)") it will not function as a trigger. Then i will have 1 rule with 1 trigger and that is what we needed.

is that clear enough?

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report