|
|
@ -39,7 +39,7 @@ class AHB_Context: |
|
|
|
|
|
|
|
|
|
|
|
doc = App.ActiveDocument |
|
|
|
doc = App.ActiveDocument |
|
|
|
for obj in doc.Objects: |
|
|
|
for obj in doc.Objects: |
|
|
|
if obj.TypeId == 'Part::Feature': |
|
|
|
if obj.TypeId in ['Part::Feature', 'App::Part']: |
|
|
|
if 'AssemblyHandbook_Stage' in obj.PropertiesList: |
|
|
|
if 'AssemblyHandbook_Stage' in obj.PropertiesList: |
|
|
|
allStages.add(obj.AssemblyHandbook_Stage) |
|
|
|
allStages.add(obj.AssemblyHandbook_Stage) |
|
|
|
|
|
|
|
|
|
|
@ -56,10 +56,15 @@ class AHB_Context: |
|
|
|
part.ViewObject.ShapeColor = (0.8,0.8,0.8,0.0) |
|
|
|
part.ViewObject.ShapeColor = (0.8,0.8,0.8,0.0) |
|
|
|
|
|
|
|
|
|
|
|
for obj in doc.Objects: |
|
|
|
for obj in doc.Objects: |
|
|
|
if obj.TypeId == 'Part::Feature': |
|
|
|
if obj.TypeId in ['Part::Feature', 'App::Part']: |
|
|
|
if 'AssemblyHandbook_Stage' in obj.PropertiesList: |
|
|
|
if 'AssemblyHandbook_Stage' in obj.PropertiesList: |
|
|
|
stageIndex = allStages.index(obj.AssemblyHandbook_Stage) |
|
|
|
stageIndex = allStages.index(obj.AssemblyHandbook_Stage) |
|
|
|
obj.ViewObject.ShapeColor = _colors[stageIndex % len(_colors)] |
|
|
|
if obj.TypeId == 'Part::Feature': |
|
|
|
|
|
|
|
obj.ViewObject.ShapeColor = _colors[stageIndex % len(_colors)] |
|
|
|
|
|
|
|
elif obj.TypeId == 'App::Part': |
|
|
|
|
|
|
|
for feature in obj.Group: |
|
|
|
|
|
|
|
if feature.TypeId == 'Part::Feature': |
|
|
|
|
|
|
|
feature.ViewObject.ShapeColor = _colors[stageIndex % len(_colors)] |
|
|
|
|
|
|
|
|
|
|
|
self._updateVisibility() |
|
|
|
self._updateVisibility() |
|
|
|
|
|
|
|
|
|
|
@ -75,7 +80,7 @@ class AHB_Context: |
|
|
|
|
|
|
|
|
|
|
|
doc = App.ActiveDocument |
|
|
|
doc = App.ActiveDocument |
|
|
|
for obj in doc.Objects: |
|
|
|
for obj in doc.Objects: |
|
|
|
if obj.TypeId == 'Part::Feature': |
|
|
|
if obj.TypeId == 'Part::Feature' in ['Part::Feature', 'App::Part']: |
|
|
|
if 'AssemblyHandbook_Stage' in obj.PropertiesList: |
|
|
|
if 'AssemblyHandbook_Stage' in obj.PropertiesList: |
|
|
|
obj.ViewObject.Visibility = self._allStagesVisible or activeStageId is None or obj.AssemblyHandbook_Stage <= activeStageId |
|
|
|
obj.ViewObject.Visibility = self._allStagesVisible or activeStageId is None or obj.AssemblyHandbook_Stage <= activeStageId |
|
|
|
|
|
|
|
|
|
|
|