how to pass IEnumerable

This is a place for people to chare the custom macros they have written.

Moderator: Moderators

icke_siegen
Posts: 1087
Joined: 02 Jul 2010, 10:29
Location: Siegen, Germany
Contact:

how to pass IEnumerable

Postby icke_siegen » 23 Jun 2018, 18:17

may I ask for an example of how to pass an IEnumerable of handles, e.g. in

Code: Select all

Handles.SetSourceHandleRangeFromHandles(IEnumerable`1 handles, Boolean retainPattern)


I tried various versions, e.g.

Code: Select all

Handles.SetSourceHandleRangeFromHandles({"playbackHandleUN=11", "playbackHandleUN=13", "playbackHandleUN=15"}, false)


But this doesn't work, and the logs say something of an expected Int.
User avatar
Gregory
Posts: 1300
Joined: 14 Dec 2007, 15:25
Location: London, United Kingdom
Contact:

Re: how to pass IEnumerable

Postby Gregory » 24 Jun 2018, 21:14

There is no syntax to define an IEnumerable in a macro so you can only use these functions if you have property that contains or method that returns that type. For example the following would be valid but it would only allow you to select fixtures which conflict with a previous exchange operation:

Code: Select all

Handles.SetSourceHandleRangeFromHandles(Handles.GetHandles(Fixtures.ConflictingHandles), false)
It is possible to pass in a list of integer values (as of version 11) so you can do the following:

Code: Select all

Handles.SetSourceHandleRange("Playbacks", {0,2,3,4})
User avatar
sideshowbond
Posts: 182
Joined: 18 Nov 2016, 20:58

Re: how to pass IEnumerable

Postby sideshowbond » 24 Jun 2018, 21:23

so there basically is currently no way of selecting multiples playback at once based on their user number?
User avatar
Gregory
Posts: 1300
Joined: 14 Dec 2007, 15:25
Location: London, United Kingdom
Contact:

Re: how to pass IEnumerable

Postby Gregory » 24 Jun 2018, 22:26

I do not believe this is currently possible.

Who is online

Users browsing this forum: No registered users and 11 guests