Created
June 4, 2019 09:29
-
-
Save rondreas/7e4606ce6064177d0337fbcde55cc0a3 to your computer and use it in GitHub Desktop.
Quick reminder of how to deal with some quirks of Modo
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
# python | |
""" | |
Snippets for dealing with Modo's Selection Service | |
""" | |
__author__ = "AndreasR" | |
import lx | |
# Get the selection service | |
sel_svc = lx.service.Selection() | |
def GetSelectionMode(): | |
""" Get the current selection mode | |
:rtype: lx.symbol | |
""" | |
# Create a storage object for integer | |
selection_type = lx.object.storage('i') | |
# Set the integer to current selection as an lx.symbol | |
sel_svc.CurrentType(selection_type) | |
return selection_type | |
def main(): | |
selection_type = GetSelectionMode() | |
msg = "Current selection type is: {}" | |
lx.out(msg.format(sel_svc.LookupName(selection_type))) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment