Skip to content

Instantly share code, notes, and snippets.

@rondreas
Created June 4, 2019 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rondreas/7e4606ce6064177d0337fbcde55cc0a3 to your computer and use it in GitHub Desktop.
Save rondreas/7e4606ce6064177d0337fbcde55cc0a3 to your computer and use it in GitHub Desktop.
Quick reminder of how to deal with some quirks of Modo
# 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