@@ -83,53 +83,58 @@ def compare_view_filters(view1, view2):
83
83
differences = []
84
84
85
85
# Compare properties of OverrideGraphicSettings
86
- # Colors
87
- c1 = ov1 .ProjectionLineColor
88
- c2 = ov2 .ProjectionLineColor
89
- if c1 .IsValid and c2 .IsValid :
90
- if c1 .Red != c2 .Red or c1 .Green != c2 .Green or c1 .Blue != c2 .Blue :
91
- differences .append ("ProjectionLineColor" )
92
- elif c1 .IsValid != c2 .IsValid :
93
- differences .append ("ProjectionLineColor" )
94
-
95
- c1 = ov1 .SurfaceForegroundPatternColor
96
- c2 = ov2 .SurfaceForegroundPatternColor
97
- if c1 .IsValid and c2 .IsValid :
98
- if c1 .Red != c2 .Red or c1 .Green != c2 .Green or c1 .Blue != c2 .Blue :
99
- differences .append ("SurfaceColor" )
100
- elif c1 .IsValid != c2 .IsValid :
101
- differences .append ("SurfaceColor" )
102
-
103
- c1 = ov1 .CutLineColor
104
- c2 = ov2 .CutLineColor
105
- if c1 .IsValid and c2 .IsValid :
106
- if c1 .Red != c2 .Red or c1 .Green != c2 .Green or c1 .Blue != c2 .Blue :
107
- differences .append ("CutLineColor" )
108
- elif c1 .IsValid != c2 .IsValid :
109
- differences .append ("CutLineColor" )
110
-
111
- c1 = ov1 .CutBackgroundPatternColor
112
- c2 = ov2 .CutBackgroundPatternColor
113
- if c1 .IsValid and c2 .IsValid :
114
- if c1 .Red != c2 .Red or c1 .Green != c2 .Green or c1 .Blue != c2 .Blue :
115
- differences .append ("CutBackgroundPatternColor" )
116
- elif c1 .IsValid != c2 .IsValid :
117
- differences .append ("CutBackgroundPatternColor" )
118
-
119
- # Not checking pattern or linestyle overrides because I'm lazy
120
-
121
- # Other appearance stuff
122
- if ov1 .Transparency != ov2 .Transparency :
123
- differences .append ("Transparency" )
124
- if ov1 .Halftone != ov2 .Halftone :
125
- differences .append ("Halftone" )
86
+ ov_attrs = [
87
+ # Colors
88
+ "ProjectionLineColor" ,
89
+ "SurfaceForegroundPatternColor" ,
90
+ "SurfaceBackgroundPatternColor" ,
91
+ "CutLineColor" ,
92
+ "CutForegroundPatternColor" ,
93
+ "CutBackgroundPatternColor" ,
94
+
95
+ # Pattern IDs
96
+ "SurfaceForegroundPatternId" ,
97
+ "SurfaceBackgroundPatternId" ,
98
+ "CutForegroundPatternId" ,
99
+ "CutBackgroundPatternId" ,
100
+ "ProjectionLinePatternId" ,
101
+ "CutLinePatternId" ,
102
+
103
+ # Line weights
104
+ "ProjectionLineWeight" ,
105
+ "CutLineWeight" ,
106
+
107
+ # Visibility flags
108
+ "IsSurfaceForegroundPatternVisible" ,
109
+ "IsSurfaceBackgroundPatternVisible" ,
110
+ "IsCutForegroundPatternVisible" ,
111
+ "IsCutBackgroundPatternVisible" ,
112
+
113
+ # Other
114
+ "Transparency" ,
115
+ "Halftone" ,
116
+ ]
117
+
118
+ for attr in ov_attrs :
119
+ val1 = getattr (ov1 , attr )
120
+ val2 = getattr (ov2 , attr )
121
+
122
+ if isinstance (val1 , DB .Color ):
123
+ if val1 .IsValid and val2 .IsValid :
124
+ if val1 .Red != val2 .Red or val1 .Green != val2 .Green or val1 .Blue != val2 .Blue :
125
+ differences .append (attr )
126
+ elif val1 .IsValid != val2 .IsValid :
127
+ differences .append (attr )
128
+ else :
129
+ if val1 != val2 :
130
+ differences .append (attr )
126
131
127
132
# More general stuff
128
133
if view1 .GetIsFilterEnabled (fid1 ) != view2 .GetIsFilterEnabled (fid2 ):
129
134
differences .append ("Enabled Status" )
130
135
131
136
if view1 .GetFilterVisibility (fid1 ) != view2 .GetFilterVisibility (fid2 ):
132
- differences .append ("Vsibility Status" )
137
+ differences .append ("Visibility Status" )
133
138
134
139
if differences :
135
140
output .print_md (
0 commit comments