hello.
just like in rhino modelspace use “Explode” .
thanks
Hi @yangf85, one way is by scripting the _Explode
command:
import rhinoscriptsyntax as rs
def ExplodeAnnotation():
obj_id = rs.GetObject("Select Dimension", rs.filter.annotation, True, True)
if not obj_id: return
rc = rs.Command("_Explode", False)
if not rc: return
obj_ids = rs.LastCreatedObjects(select=True)
ExplodeAnnotation()
_
c.
@clement oh. That’s not what I want.
in that case ,i can use RhinoObject.GetSubObject()…
i hope do not destroy the rhinoobject.
thanks
Hi @yangf85, i’ve tried that, unfortunately RhinoObject.GetSubObjects()
does not work for annotation objects, it returns an empty array.
You could just make a copy of the object before exploding it to keep the original.
btw. what are you trying to gain from the exploded objects ? Maybe there is a way to get the required information from the dimension without exploding it ?
_
c.
@clement I want create a border with dimension’s text.
so i need the dimension textentity.
Hi @yangf85,
sorry, i only see to get to the text object by exploding, then using text_obj.GetTextCorners()
to create a border as polyline.
Hack.py (1.1 KB)
(In case you want to get this border for display purposes only, you might enable the mask frame by enabling it in the dimension style) btw. there is an open item RH-50235 for exploding dimensions in RhinoCommon, it’s from here.
@dale, i think i’ve found a glitch when scripting the _Explode
command and a dimension is exploded, the following text cannot be suppressed from the command history if echo=False
:
Exploded an annotation object into 5 curves and a text object.
Curves from text may orient differently than text in viewports because of AnnotationStyle settings.
I’ve also tried to get the required information from the dimension by using dim_obj.Geometry.GetTextRectangle()
and dim_obj.Geometry.Get3dPoints()
to extract the text location and transform the rectangle points into the dimension’s plane. It seems that this approach only works properly if the dimension style is set to “In-Line” and “Aligned”. Do i miss something here ?
Example script: DimensionTextBoundingBox.py (1.0 KB)
_
c.
@clement ah, thans a lot!
i have tried use Dimension.GetTextRectangle(), But the corner points are put the Plane.WorldXY.
And these are the only AngularDimension\LinearDimension\OrdinateDimension\RadialDimension
exist GetTextRectangle() method, It takes more time to work with the other types.
And dealing with the location of the annotated text is cumbersome.
I think enabling masks might be the way to go, I’m going to try it.
Sorry about my poor English.
This only suppresses command line parameters, not information messages printed by commands.
– Dale
Hi @dale, ok i understand. Could you make GetSubObjects()
working for dimensions ? It currently returns an empty array.
thanks,
c.