I am trying to create an alias that makes you set an objects object properties to ByParent.
I found this but changing to “ByParent” doesn’t work.
! -_Properties _Pause
_Object _Color _Layer
_Linetype Continuous
_PrintColor _Layer
_PrintLineWidth 0.01 !
wim
(Wim Dekeyser)
January 8, 2025, 11:01am
2
Hej Nils -
You didn’t specify which property, and that seems to work fine for some. I’ve added a ticket to look into that for Color and Print Color.
RH-85429 Properties: Macro Access to By Parent
-wim
1 Like
wim
(Wim Dekeyser)
January 8, 2025, 4:20pm
4
Hi -
I’ve put access to the Section Style property on the list
→ RH-85436 Properties: Macro Access to Object Section Style
-wim
Is there any news on how to set object properties to all “By Parent” with an alias?
Measure
February 11, 2025, 4:02pm
6
I’ve been using python to do this:
# Attributes by Layer
# Changes all object attributes to be "by parent"
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
guidList = rs.GetObjects("Select objects", preselect = True)
if guidList:
for g in guidList:
obj = sc.doc.Objects.Find(g)
obj.Attributes.ColorSource = Rhino.DocObjects.ObjectColorSource.ColorFromParent
obj.Attributes.LinetypeSource = Rhino.DocObjects.ObjectLinetypeSource.LinetypeFromParent
obj.Attributes.PlotColorSource = Rhino.DocObjects.ObjectPlotColorSource.PlotColorFromParent
obj.Attributes.PlotWeightSource = Rhino.DocObjects.ObjectPlotWeightSource.PlotWeightFromParent
obj.Select(True)
obj.CommitChanges()
print('Changed attributes to "By Parent".')
1 Like