Hi,
Is it somehow possible to define text frame width and height.
I dont see it anywhere in text node but this function would be very useful.
Hi,
Is it somehow possible to define text frame width and height.
I dont see it anywhere in text node but this function would be very useful.
Now the question is how i attach annotation style to text entity because all i can see i can do is assign Ts as text style and not As… I want an annotation style assigned to the text without overrides or only with certain overrides.
it seems like it.
I was confused because i had expected As to go ito Text element node in the first place but how it is makes sense as well.
I got into the same problem recently.
Can’t figure out how to modified the “Text Width” like @ivan.galik 's image shown.
The RH8 components looks like:
I think I found the solution, its wrap
and rectWidth
, but 2 problems:
wrap
in RH7.Hope someone knows how to fix it:
Below is the script:
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino.Geometry as rg
sc.doc = Rhino.RhinoDoc.ActiveDoc
dimstyle_name = "ENV_INFO"
if not rs.IsDimStyle(dimstyle_name):
rs.AddDimStyle(dimstyle_name)
dimstyle = sc.doc.DimStyles.FindName(dimstyle_name)
ds = dimstyle.Duplicate()
rs.DimStyleFont(dimstyle_name, font_name)
if font_size:
try:
ds.TextHeight = float(font_size)
except:
pass
if max_width is None or max_width < 0:
max_width = 0.0
else:
max_width = float(max_width)
justification_map = {
"Left": rg.TextJustification.Left,
"Center": rg.TextJustification.Center,
"Right": rg.TextJustification.Right
}
justification_value = justification_map.get(justification, rg.TextJustification.Left)
plane = rg.Plane(position, rg.Vector3d.ZAxis)
textblock = rg.TextEntity.Create(text, plane, ds, wrap, max_width, 0.0)
textblock.Justification = justification_value
sc.doc = ghdoc