Difference between revisions of "Api.groups"

From Light Forge Wiki
Jump to: navigation, search
(Methods)
 
(14 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
 +
=Information=
 +
 +
==Group Paths==
 +
A group path is a method for specifying a group in the group hierarchy. It is defined by use of a string.
 +
 +
An empty string ("") will specify the main group.
 +
 +
To specify a child of the main group you use that child's index number ex. "1"
 +
 +
Note: the indexes are 0 based so fixture 1 in a group is 0, fixture 2 is 1, etc.
 +
 +
To specify a child of a child, you use a comma, and the index of the next child you want to select ex. "1,3"
 +
 +
You can continue in this fashion throughout the group hierarchy. If you are looking at something nested deeply it may look like "1,3,0,2,4".
  
 
=Methods=
 
=Methods=
Line 4: Line 19:
 
==getAttribute==
 
==getAttribute==
  
'''getAttribute(attribute As api.attributeTypes, groupPath As String) As Integer'''
+
'''getAttribute(attribute As [[api.attributeTypes]], groupPath As String) As Integer'''
  
 
Returns the value for a specified attribute on a specified group
 
Returns the value for a specified attribute on a specified group
 
Returns -1 if the group can't be found
 
Returns -1 if the group can't be found
  
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
print(api.groups.getAttribute(api.attributeTypes.intensity, "0,0"))
 +
</syntaxhighlight>
  
 
==getChildCount==
 
==getChildCount==
Line 15: Line 34:
 
Returns the number of children in a group
 
Returns the number of children in a group
 
Returns -1 if the group can't be found
 
Returns -1 if the group can't be found
   
+
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
print(api.groups.getChildCount("0,0"))
 +
</syntaxhighlight>
  
 
==getName==
 
==getName==
Line 23: Line 46:
 
Returns -1 if the group can't be found
 
Returns -1 if the group can't be found
  
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
print(api.groups.getName("1,1"))
 +
</syntaxhighlight>
  
==setAttribute==
+
==getProfileName==
'''setAttribute(attribute As api.attributeTypes, value As Integer, groupPath As String)'''
+
'''getProfileName(groupPath As String) As String'''
  
Sets the value of an attribute on a specified group.
+
Returns the name of the profile in use by the specified group. If this group is not a fixture and does not have a profile this function will return -1.
   
+
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
print(api.groups.getProfileName("1,0,3"))
 +
</syntaxhighlight>
 +
 
 +
==getSelectedGroups==
 +
'''getSelectedGroups() As String[]'''
 +
 
 +
Returns a list of group paths for all selected groups. If there are no groups selected then null is returned.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
groupList = api.groups.getSelectedGroups()
 +
for group in groupList:
 +
print(group)
 +
</syntaxhighlight>
  
 
==releaseAttribute==
 
==releaseAttribute==
'''releaseAttribute(attribute As api.attributeTypes, groupPath As String)'''
+
'''releaseAttribute(attribute As [[api.attributeTypes]], groupPath As String)'''
  
 
Releases the specified attribute on the specified group.
 
Releases the specified attribute on the specified group.
 +
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.groups.releaseAttribute(api.attributeTypes.intensity, "0,1")
 +
</syntaxhighlight>
  
 
==releaseGroup==
 
==releaseGroup==
'''releaseGroup(attribute As api.attributeTypes, groupPath As String)'''
+
'''releaseGroup(groupPath As String)'''
  
 
Releases the all attributes on the specified group.
 
Releases the all attributes on the specified group.
 +
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.groups.releaseGroup("1,0")
 +
</syntaxhighlight>
 +
 +
==setAttribute==
 +
'''setAttribute(attribute As [[api.attributeTypes]], value As Integer, groupPath As String)'''
 +
 +
Sets the value of an attribute on a specified group.
 +
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.groups.setAttribute(api.attributeTypes.intensity, 65535, "1,1")
 +
</syntaxhighlight>
 +
 +
==selectGroup==
 +
'''selectGroup(groupPath As String)'''
 +
 +
Sets the given group as selected.
 +
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.groups.selectGroup("0,1,1,2")
 +
</syntaxhighlight>
 +
 +
==deselectGroup==
 +
'''deselectGroup(groupPath As String)'''
 +
 +
Deselects the given group.
 +
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.groups.deselectGroup("0,1,1,2")
 +
</syntaxhighlight>
 +
 +
==clearSelection==
 +
'''clearSelection()'''
 +
 +
Deselects all selected groups.
 +
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.groups.clearSelection()
 +
</syntaxhighlight>

Latest revision as of 18:32, 9 May 2013

Contents

[edit] Information

[edit] Group Paths

A group path is a method for specifying a group in the group hierarchy. It is defined by use of a string.

An empty string ("") will specify the main group.

To specify a child of the main group you use that child's index number ex. "1"

Note: the indexes are 0 based so fixture 1 in a group is 0, fixture 2 is 1, etc.

To specify a child of a child, you use a comma, and the index of the next child you want to select ex. "1,3"

You can continue in this fashion throughout the group hierarchy. If you are looking at something nested deeply it may look like "1,3,0,2,4".

[edit] Methods

[edit] getAttribute

getAttribute(attribute As api.attributeTypes, groupPath As String) As Integer

Returns the value for a specified attribute on a specified group Returns -1 if the group can't be found

Usage:

print(api.groups.getAttribute(api.attributeTypes.intensity, "0,0"))

[edit] getChildCount

getChildCount(groupPath As String) As Integer

Returns the number of children in a group Returns -1 if the group can't be found

Usage:

print(api.groups.getChildCount("0,0"))

[edit] getName

getName(groupPath As String) As String

Returns the name of the requested group Returns -1 if the group can't be found

Usage:

print(api.groups.getName("1,1"))

[edit] getProfileName

getProfileName(groupPath As String) As String

Returns the name of the profile in use by the specified group. If this group is not a fixture and does not have a profile this function will return -1.

Usage:

print(api.groups.getProfileName("1,0,3"))

[edit] getSelectedGroups

getSelectedGroups() As String[]

Returns a list of group paths for all selected groups. If there are no groups selected then null is returned.

Usage:

groupList = api.groups.getSelectedGroups()
	for group in groupList:
		print(group)

[edit] releaseAttribute

releaseAttribute(attribute As api.attributeTypes, groupPath As String)

Releases the specified attribute on the specified group.

Usage:

api.groups.releaseAttribute(api.attributeTypes.intensity, "0,1")

[edit] releaseGroup

releaseGroup(groupPath As String)

Releases the all attributes on the specified group.

Usage:

api.groups.releaseGroup("1,0")

[edit] setAttribute

setAttribute(attribute As api.attributeTypes, value As Integer, groupPath As String)

Sets the value of an attribute on a specified group.

Usage:

api.groups.setAttribute(api.attributeTypes.intensity, 65535, "1,1")

[edit] selectGroup

selectGroup(groupPath As String)

Sets the given group as selected.

Usage:

api.groups.selectGroup("0,1,1,2")

[edit] deselectGroup

deselectGroup(groupPath As String)

Deselects the given group.

Usage:

api.groups.deselectGroup("0,1,1,2")

[edit] clearSelection

clearSelection()

Deselects all selected groups.

Usage:

api.groups.clearSelection()
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox