Difference between revisions of "IC Python API:RLPy RStatus"
From Reallusion Wiki!
Chuck (RL) (Talk | contribs) m |
Chuck (RL) (Talk | contribs) m |
||
Line 19: | Line 19: | ||
print(status.IsError()) # print false | print(status.IsError()) # print false | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | Constructor & | + | ==Constructor & Destructors== |
− | + | ||
===__init__=== | ===__init__=== | ||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
Line 32: | Line 31: | ||
'''status''' [IN] The target RStatus object. | '''status''' [IN] The target RStatus object. | ||
</div> | </div> | ||
− | Member | + | ==Member Functions== |
− | + | ||
===Clear=== | ===Clear=== | ||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> |
Revision as of 01:07, 26 March 2019
- Main article: Modules.
Detailed Description
This class is used for API level error handling. Most API methods return this class as a return value. The developer can query, clear, print the error code along with the error description.
status = RLPy.RGlobal.SetTime(RLPy.RTime(1000))
if status == RLPy.RStatus.Success:
print("sucess") # print sucess
if status:
print("sucess") # print sucess
if status.GetStatusCode() == RLPy.RStatus.Success:
print("sucess") # print sucess
print(status.IsError()) # print false
Constructor & Destructors
__init__
RLPy.RStatus.__init__ ( self, args )
The copy constructor of the class. Initialize a new RStatus object with the values from another RStatus object.
Parameters
status [IN] The target RStatus object.
Member Functions
Clear
RLPy.RStatus.Clear ( self )
Clear error codes from the RStatus instance. After this call, it will behave as if it contained Success.
GetStatusCode
RLPy.RStatus.GetStatusCode ( self )
Retrieve the type of error that occurred, as specified in the RStatusCode enumeration.
Returns
The type of error that occurred - RLPy.RStatusCode
IsError
RLPy.RStatus.IsError ( self )
Determines whether there is an error.
Return Values
true An error has occurred.
false The operation was successful