+ Reply to Thread
Results 1 to 3 of 3

Thread: Miinor questions about extrusion object support w/Python...

  1. #1
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    288

    Miinor questions about extrusion object support w/Python...

    Hi,

    Just a couple of observations about extrusion objects and Rhinoscriptsyntax/RhinoCommon:

    If I understand correctly, we have a Rhino.Geometry.Extrusion (as a Python object, not yet added to a document) and a Rhino.DocObjects.ExtrusionObject (that already exists in the document). The Extrusion has properties PathStart/PathEnd plus the PathLine method enabling us to get the extrusion path, and a bunch of other methods to get the profile(s) - this even even though if we have created the extrusion in Python, we probably already have this info somewhere.

    OTOH, an ExtrusionObject, once added to the document, doesn't retain any of these properties or methods... It seems to have become a "dumb" object, like any other polysurface. Is there any way to extract this info from an ExtrusionObject? That's were it seems to me to be most useful.

    Also, as far as Rhinoscript support goes, I note that there isn't an object filter for extrusions in selection.py; it also is not in the list on the Help page for rs.ObjectsByType. However, passing 1073741824 into ObjectsByType does work.

    Thanks, --Mitch

  2. #2
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    First the quick answer. I just added the extrusion filter in selection.py
    https://github.com/mcneel/rhinopytho...election.py#L8

    When objects are in the Rhino document, they are a combination of geometry and attributes (id, layer, color,...). For each geometry type there is a Rhino object type (Curve/CurveObject, Brep/BrepObject, Point/PointObject,...). Extrusions and ExtrusionObjects are the same as the rest of these guys. If you want access to the geometry portion of one of these rhino objects, then you need to access the Geometry property which will end up being an instance of the Extrusion class. So.. .once you have the ExtrusionObject in your script, call Geometry and you will have access to the Extrusion geometry portion of the object

    Python Code:
      obj = ...ExtrusionObject you got from somewhere...
      extrusion = obj.Geometry
      print extrusion.PathStart

  3. #3
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    288
    Great info, thanks Steve! --Mitch

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts