Run a calculation before update of model

Run a calculation before update of model

Anonymous
Not applicable
609 Views
4 Replies
Message 1 of 5

Run a calculation before update of model

Anonymous
Not applicable

Basically it's a simple question but i'm struggling 😕

I've made a simple part so it's easier to explain, once i know the mechanics i'll be able to implement it into a bigger program i've written.

 

I want to know if it's possible to pre-run a calculation on a form before pushing through your values.

I've tried to seperate the coding in two rules: a calculation code and a transfer code but I can't seem to get my head around it *shameful*

 

Reason: my part is extremely large and by every calculation i don't want it to update straight away ...

 

Thanks in advance

0 Likes
Accepted solutions (1)
610 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

Hi @Anonymous

 

if you want to pre-calculate something, just use temporary variables.

 

For the calculation of a volume this could look like this:

 

Here the Code of the calculation rule. You write the result to the temporary variable:

Volume_temp = Lenght * Width * Height

Now you display this to the user to check it and if happy with the result run this in the transfer rule:

Volume = Volume_temp

I hope this will end your worries 🙂

 

If you have any questions or suggestions, please tell me

 

Message 3 of 5

Anonymous
Not applicable

Would you be so kind to write and adapt this in the code as well?

I tried implementing what you said but i was unsuccessful unfortunately. 😕

 

For the record: I want to press "Calculation" first to see the volume without changing the model. When i'm satisfied with the Volume i want to press "Transfer" to update the model.

 

Thanks.

0 Likes
Message 4 of 5

Anonymous
Not applicable
Accepted solution

Hi @Anonymous

 

check this out.

 

You also have to uncheck the box for automaticly run rule within iLogic.

Didn't know this either 😄

 

If questions still open, just ask

 

Message 5 of 5

kelly.young
Autodesk Support
Autodesk Support

@Anonymous did the sample part with code help you out and solve your problem?

 

If you can post how it turned out or supply a part for better implementation that would be helpful, thanks!

 

Please select the Accept as Solution button if a post solves your issue or answers your question.

0 Likes