Last active
January 12, 2021 17:41
-
-
Save cgillis-aras/3d0b8a653e7895037cf77e721c754d02 to your computer and use it in GitHub Desktop.
Sample code for a hard-coded version of an action that will get the name of the User who has claimed a selected Part
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Innovator inn = this.getInnovator(); | |
// Check to see if this item is claimed at all | |
if (this.isLocked() == 0) | |
{ | |
return inn.newResult("No one"); | |
} | |
// Query to make sure that we have the locked_by_id property | |
Item part = inn.newItem("Part", "get"); | |
part.setID(this.getID()); | |
part.setAttribute("select", "locked_by_id(keyed_name)"); | |
part = part.apply(); | |
// Get the name of the user who locked this part | |
Item claimer = part.getPropertyItem("locked_by_id"); | |
string claimerName = claimer.getProperty("keyed_name"); | |
return inn.newResult(claimerName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment