Home › Forums › Problems and solutions in GDL › Parameter connections › Value{2} and put functions please
- This topic has 3 replies, 3 voices, and was last updated 6 years, 3 months ago by
Gergely Fehér.
-
AuthorPosts
-
-
January 29, 2016 at 03:54 #2144
Kristian Bursell
ParticipantFirstly I love the Value{2} command as it allows me to use an integer parameter but make it work like a string parameter. This has been very helpful recently with auto labels referencing Building Materials so that if the BM Name is altered the label updates automatically and correctly.
The problem I have is allowing for composites with varying numbers of skins. Forgive me I am being a bit lazy asking this question be thoroughly exploring tricky workarounds.
currently i have the code picking up the number of skins (iSkins) and then I am writing something like this:if iSkins = 1 then
Value{2} “parameter”, 1, array[1]
endif
if iSkins = 2 then
Value{2} “parameter”, 1, array[1], 2, array[2]
endif
and so on.
where i’d rather do it using; for n = 1 to iSKins ……put….. next n.
but obviously this doesn’t work with the Value{2} command as it doesn’t with many other commands.it would be great if we could use get and put functions with everything.any workarounds?
i haven’t tried anything else yet because.thanks
CADSWIFT
Australia -
January 29, 2016 at 04:00 #2145
Kristian Bursell
Participantsorry a couple of cropped sentences above, very tired at the moment.
I haven’t tried anything else because… i’m very busy and very tired. GDL 12hrs a day weakens the brain muscle come Friday afternoon.CADSWIFT
Australia -
January 29, 2016 at 09:25 #2146
Wesley Marnitz
ParticipantHi Kristian
I agree, I have found VALUES{2} to be very useful. I have also found that you can use arrays for both the integer and the string values.
Here is an example.
DIM num[]
FOR i = 1 TO VARDIM1(array)
num[i] = i
NEXT i
VALUES{2} “parameter” num, arrayBim Bakery
-
January 29, 2016 at 14:22 #2148
Gergely Fehér
KeymasterWesley posted the right solution, you can use arrays as the parameters of the values{2} command. The only limitation is that you should use array pairs with the same dimensions.
You can combine these 2, and you can add more than one array pair to a values{2}.Example:
values{2} “myparam” numarray1, stringarray2, intvalue1, stringvalue1, numarray2, stringarray2Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE
-
-
AuthorPosts
- The forum ‘Parameter connections’ is closed to new topics and replies.