DimStyleTextAlignment not up to date?

python
rhino6

(Lahos) #1

Hi,
dimension.py is refering to old API I guess.
I still have to work (efficently) with rhino 5 since my scripts cant work for the moment.
Is there a plan to review rhinopython soon ?

(Is “Serengeti” for WIP or Rhino 6 ?)

code from dimension.py

def DimStyleTextAlignment(dimstyle, alignment=None):
"""..."""
    ds = scriptcontext.doc.DimStyles.FindName(dimstyle)
    if ds is None: return scriptcontext.errorhandler()
    rc = int(ds.TextAlignment) <=================== HERE (seems to be TextDisplayAlignment now ?)
    if alignment is not None:
        if alignment==0: ds.TextAlignment = Rhino.DocObjects.TextDisplayAlignment.Normal
        if alignment==1: ds.TextAlignment = Rhino.DocObjects.TextDisplayAlignment.Horizontal
        if alignment==2: ds.TextAlignment = Rhino.DocObjects.TextDisplayAlignment.AboveLine
        if alignment==3: ds.TextAlignment = Rhino.DocObjects.TextDisplayAlignment.InLine
        scriptcontext.doc.DimStyles.Modify(ds, ds.Id, False)
        scriptcontext.doc.Views.Redraw()
    return rc

(Alain Cormier) #2

Hi,
We’re in the process of fixing these. Dimensions have changed considerably so we’re doing our best not to introduce breaking changes.