Hi,
I made some kind of "bucket" for molten metal and i want to know what volume it can hold. So i made the inside of the "bucket" and then get the volume from the physical properties. It worked great.
Now they asked me can you give us the volume of each centimeter of the bucket. What i would do is cut a centimeter out of the shape and get the volume. Again it worked great; the only problem is that i would be forced to do this for +1000 times to get all the volumes (its a big bucket).
Is there a way for me to get my cut out to go up each time with a centimeter and then export for each level the physical properties to excel. Making a list with all the calcutated volumes
Thanks, i really hope that there is a way! if there are any questions just ask!
In attachement a image of the bucket inside
Solved! Go to Solution.
Solved by VdVeek. Go to Solution.
have a look at this part... rule2 drives the popup but it is always step behind because it doesnt update until after its displayed the value.
go to your parameters and change the parameter 'zero' plus or minus 1
it doesnt output how you want but im no expert and just had a little lunchtime play, im sure its possible and possible to update realtime
Ok, i looked at it, and seems good! I went further on it, and came up with this, but as you say, it is a step behind!
I made these parameters and this rule
iLogicVb.UpdateWhenDone = True Row_Value = Height_Measurement / 10 row = CStr("A") & Row_Value volume = iProperties.Volume iLogicVb.UpdateWhenDone = True GoExcel.CellValue("C:\VaultWorkspace\cadcampc\12853\drawings\test.xls", "Blad1", row) = volume
**The height_measurement is against my ref point and always be +1
So what i still need it to do, is make a loop.
- Start Loop: height_measurement = 1
- Write volume value to cell "A1" --> should be set by row declaration
- Loop: height_measurement = 2 (1 + 1)
- Write volume value to cell "A2" --> should be set by row declaration
- Loop End should be when volume value = 0
- Message box : Measurements are done
I created a new rule 'rule3' which is this
iLogicVb.UpdateWhenDone = True
iLogicVb.RunRule("rule2")
then deleted the 'updateWhenDone' from rule2 and placed the line
iLogicVb.RunRule("rule3")
at the top of rule2
this is a rather ineloquent way of forcing it to update to the parameter entered, there will be a better way by someone more experienced
I would be interested in your finished rule to workout displacment of ships hulls at different waterlines and am willing to help where i can
Hi, again..
I tried some things but I still cannot get things to work, something is wrong to my code, it seems that my loop works but my write to excel doesn't.
First lets have a look at the code:
InventorVb.DocumentUpdate(True) iLogicVb.UpdateWhenDone = True Dim row As String Dim volume As Double rowvalue = 0 While Height_Measurement <= Max_Height Height_Measurement = Height_Measurement + 10 rowvalue = rowvalue + 1 InventorVb.DocumentUpdate() iLogicVb.UpdateWhenDone = True row = CStr("A") & rowvalue volume = iProperties.Volume MessageBox.Show("height = " & Height_Measurement & " row = " & row & " volume = " & volume, "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1) GoExcel.Open("C:\VaultWorkspace\cadcampc\12853\drawings\test.xls", "Blad1") GoExcel.CellValue("C:\VaultWorkspace\cadcampc\12853\drawings\test.xls", "Blad1", row) = volume GoExcel.Save GoExcel.Close If Height_Measurement > Max_Height Then MessageBox.Show("Excel sheet ready", "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1) Exit While End If End While
I made a message box that reports back to me what values are active (for testing) and there the output is almost ok. It shows that it gives a loop where the height_measurement and rowvalue is changing as I want. The volume on the other hand stays the same trough out the loop. This is because my 3D model doesn't update in the loop, and I don't know how to get it to do so.
Further my expectation would be that it in my excel-sheet I would get a list of the same volume values. But here it only shows in the first cell.
Anybody got any idea how to get it to write in all the cells that are needed and update my 3D model during my rule loop?
Thanks.
here is my part.
Its the test rule that is supressed, the other rules are other tryings but not as good (but working) you have to end inventor to exit the cyclus 😕
Jefkee, I tested this a little bit and i found the command: RuleParametersOutput() under the Document-Snippets.
When i place that line before the DocumentUpdate i get some good results. I need to test it some more before i post some code, but you can give it a try.
Rob.
I saw you have inventor 2012, I use 2013 at the moment so i just place the code here that works for me.
It creates a textfile but you can also write the information to an excel-file.
First i set the Hoogte Split propertie to 0mm, and then run the rule. There will be a textfile in the same folder as the part with the volumes in it.
Hopes you understand the code.
Rob.
edit,
i need to change that! i use 2013 now too 🙂 and its needed in excel but i will have a look later! thanks!
I will post a 'clean' code of my version that writes to excel later today. But ive got it working thanks! Bedankt!