You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing an expression to access a child of a container is over-complicated because containers use different properties to list children. All of the following objects use an App::PropertyLinkList with a different name for grouping children.
The obvious containers:
Group in App::DocumentObjectGroup, App::Part
ElementList in App::LinkGroup
Some not so obvious containers:
Group in PartDesign::Body
Links in Part::Compound
Objects in the Part::FeaturePythonBOPTools.JoinFeatures.FeatureConnect and draftobjects.clone.Clone
OriginFeatures in App::Origin
Shapes in Part::MultiFuse
Views in TechDraw::DrawPage
There are others not listed.
Now, assuming I want an expression that selects the first "child" in a container, I must use an absurd chain of conditionals to be flexible. Here is a partial example from my current project, where <<ClipStripConfig>>.Configuration_Preset is an App::PropertyXLink that the user sets to point to a container (ideally of any type they prefer) that is expected to have a first child be a spreadsheet.
There is of course OutList, but it also contains objects referenced by property expressions, so is of no use. What we need is a universal name that can be used to list ordered children of any container. Perhaps call it Children?
Great offer. I would also like to add that the “parent”-“children” connection under ideal conditions should work in both directions. Perhaps call it Parent?
But right now it only works from parent to child. (Otherwise the problem of circular dependency arises)
Perhaps this is a “system” limitation and cannot be implemented. But if we manage to do this, it would be a revolution!
For example.
Now I can make the height of the window depend on the height of the wall in which it is built.
But I can't make the wall height change if I change the window height. (only possible when using spreadsheets or “third-party” control objects. But this is sometimes an unnecessary entity).
Is there an existing issue for this?
Problem description
Writing an expression to access a child of a container is over-complicated because containers use different properties to list children. All of the following objects use an
App::PropertyLinkList
with a different name for grouping children.The obvious containers:
Group
inApp::DocumentObjectGroup
,App::Part
ElementList
inApp::LinkGroup
Some not so obvious containers:
Group
inPartDesign::Body
Links
inPart::Compound
Objects
in thePart::FeaturePython
BOPTools.JoinFeatures.FeatureConnect
anddraftobjects.clone.Clone
OriginFeatures
inApp::Origin
Shapes
inPart::MultiFuse
Views
inTechDraw::DrawPage
There are others not listed.
Now, assuming I want an expression that selects the first "child" in a container, I must use an absurd chain of conditionals to be flexible. Here is a partial example from my current project, where
<<ClipStripConfig>>.Configuration_Preset
is anApp::PropertyXLink
that the user sets to point to a container (ideally of any type they prefer) that is expected to have a first child be a spreadsheet.<<ClipStripConfig>>.Configuration_Preset.TypeId == <<App::DocumentObjectGroup>> ? <<ClipStripConfig>>.Configuration_Preset.Group[0] : <<ClipStripConfig>>.Configuration_Preset.TypeId == <<App::Part>> ? <<ClipStripConfig>>.Configuration_Preset.Group[0] : <<ClipStripConfig>>.Configuration_Preset.TypeId == <<App::LinkGroup>> ? <<ClipStripConfig>>.Configuration_Preset.ElementList[0] : False
There is of course
OutList
, but it also contains objects referenced by property expressions, so is of no use. What we need is a universal name that can be used to list ordered children of any container. Perhaps call itChildren
?Full version info
Subproject(s) affected?
Core
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: