Forum Allplan

[Domanda] Setting values to a position of array parameter


Hi everyone,
I'm trying to setting a value in the second position of an array parameter with I_INFIELD_2.

When i try to access in the second position of cara_femella I allways have a 0.
How I can set an array so that it set the result?
Thanks.

My code:

Master:
DIM cara_femella[20]

interface script:
I_INFIELD_2 cara_femella[2], 200, 200, 25 , 22 , 7

Hello,

It could be correct like this:

I_INFIELD_2 cara_femella [ 2 ] , 200 , 200 , 25 , 22

Why did you add ", 7"?


Hi Bertrand_C,
I remove the "7" and still doesn't work...

I Attach the code, I'm using Allplan 2023.
The checkboxes created by I_INFIELD_2 can't being checked.
I dont know how to proceed.
Thanks.

Allegati (1)

Type: text/xml
582 scaricato
Size: 42,92 KiB

Hello Marc,

The syntax of your checkboxes is correct.
You have to define the dimension of the arrays "manually", not by using "DIM" or "REDIM".
In addition, DIM is only to declare a new local array.
You can use dynamical array, but to be able to use 10 items, you have to assign a value to the 10th item (example: my_array [ 10 ]= 0 ). Then, the other items get the default value if nothing is assigned yet.
In your case, the better thing is to define the number of items by clicking on the "+" button (see attached image).
To define your array as dynamical, you have to enable the third button with "[...]".


Allegati (1)

Type: image/png
23 scaricato
Size: 8,38 KiB

Hi Bertrand_C,
Now it works! Merci!