forked from mcneel/rhino-developer-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleDescribeObject.py
31 lines (28 loc) · 1.17 KB
/
SampleDescribeObject.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
################################################################################
# SampleDescribeObject.py
# Copyright (c) 2017 Robert McNeel & Associates.
# See License.md in the root of this repository for details.
################################################################################
import Rhino
import rhinoscriptsyntax as rs
# Reports detailed technical information about the data structure
# of the selected objects.
def SampleDumpGeometry():
obj_id = rs.GetObject("Select object to list")
if obj_id:
geom = rs.coercegeometry(obj_id)
dump = Rhino.Runtime.HostUtils.DebugDumpToString(geom)
print dump
# Reports object properties details
def SampleDescribeObject():
obj_id = rs.GetObject("Select object for displaying detailed object properties")
if obj_id:
obj = rs.coercerhinoobject(obj_id)
log = Rhino.FileIO.TextLog()
obj.Description(log)
print log
# Check to see if this file is being executed as the "main" python
# script instead of being used as a module by some other python script
# This allows us to use the module which ever way we want.
if __name__ == "__main__":
SampleDescribeObject()