Curve baking , attributes and geometry


I have a curve in Grasshopper (curve1) that is imported from Rhino, I’m trying to bake it into Rhino (I know it seems odd to bake it because it already exists in Rhino. But long story short, I’m doing this for animation purpose.)
so here is the code and the error message, I don’t understand why there is no attribute “Geometry”. I tried the code with coerce and without coerce

   print curve1 

<Rhino.Geometry.NurbsCurve object at 0x00000000000013B6 [Rhino.Geometry.NurbsCurve]>

     sc.doc = ghdoc
     doc_object= rs.coercecurve(curve1)
     geometry = doc_object.Geometry 
     attributes = doc_object.Attributes      
     sc.doc = Rhino.RhinoDoc.ActiveDoc
     rhino_bake = sc.doc.Objects.Add(geometry,attributes)

Runtime error (MissingMemberException): ‘NurbsCurve’ object has no attribute ‘Geometry’

(Lando Schumpich) #2

have a look at this:
type hint for the curve should be GUID, doesn’t work with internalised data because GUIDs are not stored :neutral_face: (4.8 KB)

The NurbsCurve Class indeed has no Method to get the attributes, i only know of the RhinoObject Class.


@lando.schumpich, thank you so much, I didn’t realize that the NurbsCurve class doesn’t have attributes. Your code worked.

I just realized that I accidentally put the title “Pramiko FTP module” to this post, because it was a draft question that I previously posted :slight_smile:

I’m glad you looked at the post and answered it even though it had the wrong title.