Write parameters into excel with Ilogic

Anonymous

Write parameters into excel with Ilogic

Anonymous
Not applicable

Hi

I want Inventor to write a parameter into excel after I have updated the parameter "Rotation". I got the ilogic script to write to excel but it does not update the geometri between the loops. Have I missed a update command?

 

BR/Goran

 

 

 

 

 

 

 

 

SyntaxEditor Code Snippet

ExcelFile = "C:\_Vault Workspace\Designs\15\15-0161 Goran Optiska modeller\Penta prisma\Pentaprisma resultat.xlsx"


i=1
While (i<360)
    rotation = i
    


    column_vinkel = "A" & i+1
    column_Vinz = "B" & i+1
    column_Viny = "C" & i+1
    column_Voutx = "D" & i+1
    column_Voutz = "E" & i+1
    GoExcel.CellValue(ExcelFile, "Ark1",column_vinkel) = i
    GoExcel.CellValue(ExcelFile, "Ark1",column_Vinz) = Vinz
    GoExcel.CellValue(ExcelFile, "Ark1",column_Viny) = Viny
    GoExcel.CellValue(ExcelFile, "Ark1",column_Voutx) = Voutx
    GoExcel.CellValue(ExcelFile, "Ark1",column_Voutz) = Voutz
    
    i=i+1
End While
GoExcel.Save

 

 

 

 

 

 

0 Likes
Reply
746 Views
2 Replies
Replies (2)

Anonymous
Not applicable

Hi again

I missed to say that my parameter "Rotation" will change the geometry on my Inventor part. Parameter Viny, Vinz, Voutx and Voutz are parameters that vill be changed due to parameter Rotation so I only want to read them.

I want to use Inventor as an "advanced calculator".

 

BR/Goran

0 Likes

Anonymous
Not applicable

Now it works, but not sure why?!?

//Goran

 

SyntaxEditor Code Snippet

GoExcel.CellValue(ExcelFile, "Ark1","E1") = "Voutz"
While (i<360)
    Parameter("rotation") = i
    
    iLogicVb.UpdateWhenDone = True
    ThisApplication.ActiveDocument.Update()
    column_vinkel = "A" & i+1
    column_Vinz = "B" & i+1
    column_Viny = "C" & i+1
    column_Voutx = "D" & i+1
    column_Voutz = "E" & i+1
    GoExcel.CellValue(ExcelFile, "Ark1",column_vinkel) = i
    GoExcel.CellValue(ExcelFile, "Ark1",column_Vinz) = Parameter("Vinz")
    GoExcel.CellValue(ExcelFile, "Ark1",column_Viny) = Parameter("Viny")
    GoExcel.CellValue(ExcelFile, "Ark1",column_Voutx) = Parameter("Voutx")
    GoExcel.CellValue(ExcelFile, "Ark1",column_Voutz) = Parameter("Voutz")
    GoExcel.Save
    i=i+1
End While  

 

0 Likes