Drive a excel file with userform

Drive a excel file with userform

Anonymous
Not applicable
907 Views
15 Replies
Message 1 of 16

Drive a excel file with userform

Anonymous
Not applicable

Hello

 

I what to learn about iLogic rules and codes and i have seen ther is this User Form.

 

So, i make a excel file with parameters: "Höhe", "Breite" and "Länge".

The Parameter Länge change its value when i change "Höhe" und "Breite".

 

The exel tabell ist linked externaly with the part. i use excel 2013 and inventor 2015.

 

Is it posible to make a userfrom, that consist of "Höhe" und "Breite" field to cnage the "Länge" parameter?

 

I make a userform but its only a sample what i whant. I cnt chance it

 

 

0 Likes
908 Views
15 Replies
Replies (15)
Message 2 of 16

Jacques.Grobler
Advocate
Advocate

Hi Alesandar

 

Is there a reason why you want to use excel userform and not only use iLogic?

 

iLogic has its own built-in forms.

0 Likes
Message 3 of 16

Anonymous
Not applicable

Hello and than you for the replay

 

Because, my excel ist with formulas linked

 

i can not do ROUND....or?

 

A know how to link parameters from parameter tabell in invenotr in a user form, but it is posible to make it with excel.

0 Likes
Message 4 of 16

Jacques.Grobler
Advocate
Advocate
Sorry for the many questions...

1. You want to write an Excel userform to fill in values in Excel, and then iLogic updates the part?

OR

2. You want to have an iLogic userform that sends "Höhe" and "Breite" to Excel, which calculates "Länge" and send that back to Inventor?
0 Likes
Message 5 of 16

Anonymous
Not applicable

The answer 2.

 

To calculate the "Länge". To keep the formula in the userform (to link the formula from excel with user form), that i can calculate it

0 Likes
Message 6 of 16

Jacques.Grobler
Advocate
Advocate

Ok

 

So here are some references that will help you with the passing of parameters from Inventor to Excel:

The youtube is very simple in my opinion...

 

https://www.youtube.com/watch?v=eJ0MiDVJvOc

http://forums.autodesk.com/t5/inventor-general-discussion/how-do-i-export-ilogic-parameters-into-exc...

 

and here is a reference that will help you with creating an iLogic userform:

 

http://www.inventortales.com/2012/06/using-ilogic-form-to-make-rule-user.html

 

I hope this helps you on your journey

0 Likes
Message 7 of 16

Anonymous
Not applicable

Much thanks but this is for export parameters to excel

 

I want to export parapters from excel to user form

0 Likes
Message 8 of 16

Jacques.Grobler
Advocate
Advocate

I missed htat you already have a userform in inventor...

 

So your inputs on the userform is readonly because Excel has "control" of those parameters...

 

What I would have done was create 2 extra parameters, maybe called excel_Breite and excel_Hohe under the parameters, and then have the iLogic form point to them, then export them to excel, then excel would import the new values...

0 Likes
Message 9 of 16

Anonymous
Not applicable

https://www.youtube.com/watch?v=jUeKUbr2km4

 

I have found this Video.

 

Here is a code

 

ExcelFile = "C:\Users\Aleksandar.Jovicic\Desktop\Probe iLogic\Probe iLogic" & iProperties.Value("Custom", "PropertyName") &".xlsx"

 

What means: "PropertyName" ? Where are this properies in my part?

 

I this video he writes: "Order Number"

0 Likes
Message 10 of 16

Jacques.Grobler
Advocate
Advocate
The propertyname referes to a ciustom property that you can create under iproperties.

So he would have gone and created a custom iproperty called "Order Number"

Are you trying to work between 2 different excel files or the same 1?
0 Likes
Message 11 of 16

Anonymous
Not applicable

I want only one excel linked with inventor on a assembly/part and to drive it with my user from

0 Likes
Message 12 of 16

Jacques.Grobler
Advocate
Advocate

Have you had a look at the part and excel I attached?

0 Likes
Message 13 of 16

Anonymous
Not applicable

yes thats exactly what i want

 

thaks!

 

can i whrait with this a much complexer exel tabel?

0 Likes
Message 14 of 16

Jacques.Grobler
Advocate
Advocate
Yes you can
0 Likes
Message 15 of 16

Anonymous
Not applicable

Hello again

 

I have tried just to edt the part, to create i hole

 

The hole have min and max diameter, and i have choose the average

 

But, i cant insert the parameter "Loch" in my userform

 

When i save the file it will be deleted

 

i put just:

GoExcel.CellValue(filePath, "Tabelle1", "B2") = excel_Loch

 

and the "excel_Loch" is not blue

 

0 Likes
Message 16 of 16

Jacques.Grobler
Advocate
Advocate

The fact that "excel_Loch" is red not blue is because iLogic is telling you that it doesn't know which parameter you are pointing at, so you first have to go and add the parameter under your parameters...  Manage -> Parameters

 

Then next you will see that all your excel references under parameters are marked in yellow, this indicates that Inventor thinks something is wrong with your excel and when you want to rebuild, it will not update model.  This is because your Hohe value (B2) is empty. Never use an empty cell, if you don't want a value there, put a 0.

 

Then try run again and let me know if it does what you want

0 Likes