File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -788,12 +788,20 @@ def DimStyleTextAlignment(dimstyle, alignment=None):
788
788
"""
789
789
ds = scriptcontext .doc .DimStyles .FindName (dimstyle )
790
790
if ds is None : return scriptcontext .errorhandler ()
791
- rc = int (ds .TextAlignment )
791
+ # NOTE:
792
+ # this function is about text alignment so return alignment value
793
+ rc = int (ds .DimTextLocation )
792
794
if alignment is not None :
793
- if alignment == 0 : ds .TextAlignment = Rhino .DocObjects .TextDisplayAlignment .Normal
794
- if alignment == 1 : ds .TextAlignment = Rhino .DocObjects .TextDisplayAlignment .Horizontal
795
- if alignment == 2 : ds .TextAlignment = Rhino .DocObjects .TextDisplayAlignment .AboveLine
796
- if alignment == 3 : ds .TextAlignment = Rhino .DocObjects .TextDisplayAlignment .InLine
795
+ # NOTE:
796
+ # for backward compatibility, lets set the "horizontal to view" if
797
+ # alignment value is '1' - eirannejad 2025-03-17 (RH-86539)
798
+ if alignment == 1 : ds .DimTextOrientation = Rhino .DocObjects .TextOrientation .InView
799
+
800
+ # set dim text location
801
+ if alignment == 3 : ds .DimTextLocation = Rhino .DocObjects .DimensionStyle .TextLocation .InDimLine
802
+ if alignment == 0 or alignment == 2 :
803
+ ds .DimTextLocation = Rhino .DocObjects .DimensionStyle .TextLocation .AboveDimLine # default
804
+
797
805
scriptcontext .doc .DimStyles .Modify (ds , ds .Id , False )
798
806
scriptcontext .doc .Views .Redraw ()
799
807
return rc
You can’t perform that action at this time.
0 commit comments