iLogic tank volume demonstrator

iLogic tank volume demonstrator

JJ_PL
Participant Participant
677 Views
13 Replies
Message 1 of 14

iLogic tank volume demonstrator

JJ_PL
Participant
Participant

Hello,

 

I have a bit of a conundrum, just as 3d modeling holds no problems for me, ilogic still causes me huge problems and the tutorials completely miss my needs. I would need someone to explain to me how to modify my file (Volume0.2) so that it behaves like the one I found some time ago somewhere on the internet(Volume iLogic2015). Specifically, I would like to easily define the geometry of the tank using a form, and as a result receive the filling in liters and the empty space above also in liters. It would be nice to add a few more data, but if I manage to move with the basis, I think I will be able to implement the modifications myself. Thanks in advance for your help

0 Likes
Accepted solutions (1)
678 Views
13 Replies
Replies (13)
Message 2 of 14

kacper.suchomski
Mentor
Mentor

Hi

The sample file contains the Split command, which divides the model into two solids.
In the next step, a iLogic rule was created that reads the volumes of these solids.
The height of the Split is defined by a user parameter and can be controlled (input) in the form.
The volume, on the other hand, is read-only and displayed in the form.


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

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.


Message 3 of 14

JJ_PL
Participant
Participant

Hello Kacper, 

 

Thank you very much for your answer. You basicly explained how this file work, but i would like to go deeper. What rule reads the volumes? How to contorol hegiht of the split by input of the form? those answers i am looking for

 

Regards

0 Likes
Message 4 of 14

kacper.suchomski
Mentor
Mentor

In the iLogic browser, there are 2 rules, one of which is responsible for reading the volume. You can browse and learn about them just like the history of the model. You can even copy them.

At this stage of learning, we can say that a form is a dedicated parameters dialog box (its capabilities are greater, but this is a good start). The parameters in the form are controlled in the same way as in the Parameters dialog box - by entering the desired value in the appropriate cell. The difference is that the form contains exactly the parameters you expect and in the form you expect. On YouTube, you will find several hundred videos showing the process of creating a form.


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

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.


0 Likes
Message 5 of 14

JJ_PL
Participant
Participant

Kacper,

 

You have motived me to go on my own as far as i could, and now have 2 more specific question:

 

1. How in iLogic split the object so i can messure two volumes? I made some experiments with code from old file, without success

2. Why when "filling" colors work propetly only in middle part ? Above and below the cylindrical part it does not work

 

Regards 

0 Likes
Message 6 of 14

kacper.suchomski
Mentor
Mentor

In the file you sent, you used the Split function in surface mode - you actually traced a new edge this way. The split tool should be used in solid mode. This way you will get a multi-solid part.

The iLogic rule in the example uses names of these solids to read the volumes.


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

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.


0 Likes
Message 7 of 14

JJ_PL
Participant
Participant

Hi Kacper,

 

I will answer for both of your answers in one text. 

 

Changing the split function to a solid mode was very helpfull, and push my issue miles forward. Secondly I know how the forms works, there is one implemented in this file. I am still struggling with "backend" - i know how I want this file to work, but don't know how to write a code. As you said there is several hundred videos about it. I will look for the answer there, thank you for your answers and patience

 
Regards
0 Likes
Message 8 of 14

kacper.suchomski
Mentor
Mentor

If, as per the first post, you want your model to behave the same, you can simply copy the content inside the rule (or the entire rule) to your file and edit the variable fields in the content to match your parameters (body names and volume parameters).

But if you want to do something different, you need to describe your goals precisely, because often different paths lead to different goals.


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

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.


0 Likes
Message 9 of 14

JJ_PL
Participant
Participant

Hello Kacper & Autodesk community!

 

I have some time to work on my file with hints from Kacper and some internet sources.

 

First of all my file works! Almost as good as I want. There is two details for which I can't find answer.

 

How can I decrese numbers shown after the coma? And is it there easy way to add units (liters, %, etc) in program/rule?  

 

2.png

 

Now i just add "L" it in addnotation, I am just curious how it works

 

There is few thinks I would like to improve/correct

 

1. When I goes off with "fill" parameter from form(Volume check), color (fill level) change only in cilindrical part but not in bottoms - could someone explain why?

2. Second point could be more tricky, so I will try to explain it well. If I can set a hight of "fill" level and read the volume of the models solid bodies, can I reverse the process? I want to input volume in liters and hope that the program calculate and set correct hight. Where to start? How would you guys bite this process?

 

Regards

 

Jakub

0 Likes
Message 10 of 14

JJ_PL
Participant
Participant

Hi Guys,

 

I want to Bump a little my post.

 

Update:

 

1. Still don't understand how rounding in ilogic works, and how to add text to show in code. Text i mean to add "L" or "%" after a solution.

 

2. I have figured out why color on the model was crashing, the solution was to put a body apperance in body properties and tick "clear all overrides"

 

Jakub_JasinskiCXTB5_0-1743669542736.png

3. Complicated point with reverse calculation is open - i have no idea how to do it

 

If there will be no asnwers for next weeks I will accept solution, and close the topic - than start a new one more precise

 

Fell free to use my file 

 

Regards

 

JJ

 

 

0 Likes
Message 11 of 14

cidhelp
Advocate
Advocate
Accepted solution

Hello @JJ_PL ,

 

to get the Fill (height) for a given MEDIUM (volume), you can iterate the Fill until the MEDIUM is reached.

I created a rule that asks for the target MEDIUM (Volume) and then increases/decreases the Fill (height). Actually this iterations are started with a step of 100 mm, than 10 mm (backwards), than 1 mm (backwards), 0.1 mm (backwards) and finally with step 0.01 mm (backwards).

See my video:

Look at the attached file. I created the rule ComputeHeight (rule is supressed), that calls your rule Volume JJ inside.

The goal ist to update all parameters on every iteration step.

0 Likes
Message 12 of 14

JJ_PL
Participant
Participant

@cidhelp thank you very much - it is even beyond my farrest expectation! Code is great!

 

I have tried to "clean up" the file - sketch, names, diameteres. colors etc. I did it with care to change everthing 1:1 but code stops working 😕

 

Error code is:

 

"

Error on line 5 in rule: CumputeHeight, in document: Volume 0.6.ipt

Konwersja z ciągu "" na typ 'Double' nie jest prawidłowa.

"

it means that conversion for "double" is wrong

 

And the program starts to increase high to infinity 

 

Any idea why it have happened?

 

Regards

 

JJ

0 Likes
Message 13 of 14

StKrause
Contributor
Contributor

Hi @JJ_PL ,

 

depending on reaching a target working volume (VOL1) or target spare volume (VOL2) the rule has to compute with VOL1 or VOL2. Additionally the operators < and > have to be switched. I have 2 Rules, one for going to target working volume and one for goint to target spare volume.

0 Likes
Message 14 of 14

JJ_PL
Participant
Participant

@StKrause 

 

Thank you for that! 

 

I thing I know how the rule should work, in this case swiching "and" in code was a problem?

 

JJ

 

 

0 Likes