Does either (or both) exist?
Hi,
Something like an “object model diagram” doesn’t exist as far as I know.
As for “dumping” objects, most objects in rhinocommon have delete methods to reclaim their used resources (e.g. Rhino.Geometry.Point.Dispose()
).
Hi diff-arch and thanks for the reply!
I used to program in AutoCAD’s most widely-used API language (AutoLISP). They have a function called “vlax-dump-object” which displays a list of all of an objects properties and methods. The “dumping” must be an ActiveX term or something (which I don’t think most programmers are familiar with). I guess a better way to phrase my question would be whether or not there is a similar function in RhinoPython or RhinoCommon.
The picture is just a screen shot of AutoCAD after running the “dump” function on a leader object.
Generally in Python, you can iterate over class members and their values with vars(object.items())
, however the object __dict__
needs to exist, and - if I recall correctly - this doesn’t work with RhinoCommon at least.
A workaround that I know of is using the inspect
module:
Example:
import Rhino.Geometry as rg
import inspect
pt = rg.Point3d(0.1, 7.3, 1.34)
for member, value in inspect.getmembers(pt):
print member, value
Add <built-in function Add>
ArePointsCoplanar <built-in function ArePointsCoplanar>
Clone <built-in method Clone of Point3d object at 0x000000000000006D>
CompareTo <built-in method CompareTo of Point3d object at 0x000000000000006D>
CullDuplicates <built-in function CullDuplicates>
DistanceTo <built-in method DistanceTo of Point3d object at 0x000000000000006D>
DistanceToSquared <built-in method DistanceToSquared of Point3d object at 0x000000000000006D>
Divide <built-in function Divide>
EpsilonEquals <built-in method EpsilonEquals of Point3d object at 0x000000000000006D>
Equals <built-in method Equals of Point3d object at 0x000000000000006D>
FromPoint3f <built-in function FromPoint3f>
GetHashCode <built-in method GetHashCode of Point3d object at 0x000000000000006D>
GetObjectData <built-in method GetObjectData of Point3d object at 0x000000000000006D>
Interpolate <built-in method Interpolate of Point3d object at 0x000000000000006D>
IsValid True
MaximumCoordinate 7.3
MinimumCoordinate 0.1
Multiply <built-in function Multiply>
SortAndCullPointList <built-in function SortAndCullPointList>
Subtract <built-in function Subtract>
ToString <built-in method ToString of Point3d object at 0x000000000000006D>
Transform <built-in method Transform of Point3d object at 0x000000000000006D>
TryParse <built-in function TryParse>
X 0.1
Y 7.3
Z 1.34
__add__ <built-in method __add__ of Point3d object at 0x000000000000006D>
__class__ <type 'Point3d'>
__delattr__ <built-in method __delattr__ of Point3d object at 0x000000000000006D>
__div__ <built-in method __div__ of Point3d object at 0x000000000000006D>
__doc__ Represents the three coordinates of a point in three-dimensional space,
using System.Double-precision floating point values.
Point3d(x: float, y: float, z: float)
Point3d(vector: Vector3d)
Point3d(point: Point3f)
Point3d(point: Point3d)
Point3d(point: Point4d)
__eq__ <built-in method __eq__ of Point3d object at 0x000000000000006D>
__format__ <built-in method __format__ of Point3d object at 0x000000000000006D>
__ge__ <built-in method __ge__ of Point3d object at 0x000000000000006D>
__getattribute__ <built-in method __getattribute__ of Point3d object at 0x000000000000006D>
__getitem__ <built-in method __getitem__ of Point3d object at 0x000000000000006D>
__gt__ <built-in method __gt__ of Point3d object at 0x000000000000006D>
__hash__ <built-in method __hash__ of Point3d object at 0x000000000000006D>
__init__ <built-in method __init__ of Point3d object at 0x000000000000006D>
__le__ <built-in method __le__ of Point3d object at 0x000000000000006D>
__lt__ <built-in method __lt__ of Point3d object at 0x000000000000006D>
__mul__ <built-in method __mul__ of Point3d object at 0x000000000000006D>
__ne__ <built-in method __ne__ of Point3d object at 0x000000000000006D>
__neg__ <built-in method __neg__ of Point3d object at 0x000000000000006D>
__new__ <built-in function __new__>
__radd__ <built-in method __radd__ of Point3d object at 0x000000000000006D>
__reduce__ <built-in method __reduce__ of Point3d object at 0x000000000000006D>
__reduce_ex__ <built-in method __reduce_ex__ of Point3d object at 0x000000000000006D>
__repr__ <built-in method __repr__ of Point3d object at 0x000000000000006D>
__rmul__ <built-in method __rmul__ of Point3d object at 0x000000000000006D>
__rsub__ <built-in method __rsub__ of Point3d object at 0x000000000000006D>
__setattr__ <built-in method __setattr__ of Point3d object at 0x000000000000006D>
__setitem__ <built-in method __setitem__ of Point3d object at 0x000000000000006D>
__sizeof__ <built-in method __sizeof__ of Point3d object at 0x000000000000006D>
__str__ <built-in method __str__ of Point3d object at 0x000000000000006D>
__sub__ <built-in method __sub__ of Point3d object at 0x000000000000006D>
__subclasshook__ <built-in method __subclasshook__ of Point3d object at 0x000000000000006D>