algorithmic modeling for Rhino
Hi Michael,
no, AnnotationObjectBase is too generic. You need to get at the actual annotation to be able to set text. I've never dealt with any annotations before though so I'm as much in the dark as you are.
You'll probably need to drill down to any of the annotation classes in Rhino.Geometry:
AnnotationBase
LinearDimension
RadialDimension
AngularDimension
OrdinateDimension
--
David Rutten
david@mcneel.com
Poprad, Slovakia
thanks david for you fast response. I deleted the old annotation with a new one instead. This works best. I had problem with the casting as normal.
Rhino.Geometry.Leader lead_this = leader_catched_in_active_doc_and_casted_down;
Point3d[] pt_list = lead_this.[i do not find the pointlist]; /// ????????
doc.Objects.AddLeader(name_out, Rhino.Geometry.Plane.WorldXY, pt_lst_2d);
Rhino.Geometry.Leader doesn't have any methods yet. It's just an empty class that wraps the Rhino C++ leader. If you want to use annotations you'll need to bug Steve, otherwise nothing might happen until I start needing them in Grasshopper.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Why doesn't the casting work? You cannot cast an object in the Rhino document directly to a geometry type, because objects in Rhino do not derive from geometry types. The following code works for me:
Dim obj As New Rhino.DocObjects.ObjRef(id)
If (obj.Geometry() Is Nothing) Then
Print("Object with id:{0} could not be found", id)
Return
End If
Dim geo As GeometryBase = obj.Geometry()
Dim ann As AnnotationBase = TryCast(geo, AnnotationBase)
If (ann Is Nothing) Then
Print("Object with id:{0} is not an annotation object", id)
Return
End If
Dim ld As LinearDimension = TryCast(ann, LinearDimension)
If (ld Is Nothing) Then
Print("Object with id:{0} is not a linear dimension", id)
Return
End If
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by