Hello,
I'm an Inventor 2011 user and I'm writing a Ilogic script to update an assembly. For this I want to use a variable in a name.
For example d1 till d10 will be given the value 25.
Is it possible to define "d" combined with a variable "n" . The script should be something like this:
n=1
for n<11
dn=25
n=n+1
end
Thank you in advance
You can't do it directly with variable names. But you can do it with the Parameter function:
For n = 1 To 11
Parameter("d" & n) = 25
Next
Thank you for your reply.
I've given the wrong example. "d" is not a parameter, but just a name. It could be everthing. Is it still possible?
The Ilogic part containing my problem has been listed below:
********************************************************************
Con_MLA1 = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B2")
Con_MLA2 = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B3")
Con_MLA3 = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B4")
Con_MLA4 = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B5")
Con_MLA5 = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B6")
Con_MLA6 = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B7")
If Con_MLA1 = "MLA270L" Or Con_MLA1 = "MLA270L_centered" Or Con_MLA1 = "MLA270Lslinger" Or Con_MLA1 = "MLA270LERC" Or Con_MLA1 = "MLA270LERCcentered" Or Con_MLA1 = "MLA270LERC+slinger" Then
Floc = "C:\Work\Samenwerken\Master\_MLA270Links\"
Else Floc = "C:\Work\Samenwerken\Master\"
End If
*************************************************************************
The lower part I want to run 6 times
You can't do it with the name itself but you can use an array and try that.
Dim Con_MLA(6) as String Con_MLA(0) = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B2") Con_MLA(1) = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B3") Con_MLA(2) = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B4") Con_MLA(3) = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B5") Con_MLA(4) = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B6") Con_MLA(5) = GoExcel.CellValue("Samenwerken.xls", "Blad1", "B7") For i As Integer = 0 To 5 If Con_MLA(i) = "MLA270L" Or Con_MLA(i) = "MLA270L_centered" Or Con_MLA(i) = "MLA270Lslinger" Or Con_MLA(i) = "MLA270LERC" Or Con_MLA(i) = "MLA270LERCcentered" Or Con_MLA(i) = "MLA270LERC+slinger" Then Floc = "C:\Work\Samenwerken\Master\_MLA270Links\" Else Floc = "C:\Work\Samenwerken\Master\" End If Next i