Extrusion Objects


#1

Hi Dale, hi Steve,
Let’s see how well support will work in discourse… :wink:

I want to use Extrusions within my Steel Detailing PlugIn. So far I can add these but I do not see a way to retrieve generic information. It would be great to have a RS method which returns the basic properties i.e. extract the curves, the plane, the height and cap status. I know there are more complex extrusions with miters, but somewhere it needs to start…

Or can this be done with RhinoCommon meanwhile?

Thanks for your feedback,

  • Jess

(Steve Baer) #2

Welcome Jess! I think our support is only going to get better using discourse :smile:

Dale is on vacation this week, but I’m sure we can figure out some RS functions to add for getting information from extrusions. In the meantime, yes you could use RhinoCommon to get at extrusion properties if you are using python (I’m not entirely sure this could be done from RhinoScript). Let me know if you are using python and I’ll try to put a sample together for you.


#3

Thanks Steve! Indeed, seems to work great here!

I’m using Python occasionally for my needs. I’d like to use it more, but it is hard to convince my colleges to deal with many separate scripts. They prefer one compiled plugin with everything inside. However, if there is no solution with RS then they will also use a python-script. It would be great if you can help me with an example,

P.S. I hope discourse will bring rhino.python back to the group. It definitely deserves more attention.


(Steve Baer) #4

That’s one of the goals. There are python questions posted on the rhino.python forum, the grasshopper forum, the rhino newsgroup, the rhino-plug-ins newsgroup, personal email, … Makes it kind of hard for people who just want to “watch” and learn from existing posts.

If the discourse forum works well (and I do think it is working well) we will stop the rhino.python forum and direct questions to here.


(Steve Baer) #5

Here’s a python script that creates some curves from an extrusion

import rhinoscriptsyntax as rs
import scriptcontext

def getextrusionpieces():
    id = rs.GetObject("select extrusion", rs.filter.extrusion)
    # coerce the id into a Rhino.Geometry.Extrusion object
    extrusion = rs.coercegeometry(id)
    if extrusion:
        ids = []
        for i in range(extrusion.ProfileCount):
            start_curve = extrusion.Profile3d(i,0)
            end_curve = extrusion.Profile3d(i,1)
            sid = scriptcontext.doc.Objects.AddCurve(start_curve)
            eid = scriptcontext.doc.Objects.AddCurve(end_curve)
            ids.append(sid)
            ids.append(eid)
        line_id = rs.AddLine(extrusion.PathStart, extrusion.PathEnd)
        ids.append(line_id)
        rs.SelectObjects(ids)
        
if __name__=="__main__":
    getextrusionpieces()

#6

Thank you Steve! This is great and will get me going…

Are there any news regarding “Python Script Packing” for user friendly distribution?

  • Jess

(Steve Baer) #7

Not yet. We need to figure out a better long term solution than what was provided with the older RhinoScript compiler.