Hello,
is there a consistent system of the visibility in FreeCAD? To example, for a boolean operation, the children get invisible, because a boolean operation creates a complete new object. In contrast to this, the children of an App::Part remain visible because no new object is created, but the objects are merely grouped.
Is thery any possibility to get this information in Python (or a general rule I don't know for the visibility of the children)?
Thanks in advance!
usbhub
Visibility system in FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Visibility system in FreeCAD
Each object has a ".Visibility" property that tells if it is visible or hidden.
Re: Visibility system in FreeCAD
I don't understand what you mean by "rule", but basically every scripted object in FreeCAD, that is, objects that are meant hold a shape in the 3D view, and which are derived from Part Feature, have a Visibility attribute (boolean). You can read it and set it as you wish.
Code: Select all
obj = App.ActiveDocument.addObject("Part::Feature", "Name")
obj.ViewObject.Visibility = False
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Visibility system in FreeCAD
Oh, I think there is a misapprehension. I don't mean the visibility of the object itself, I mean the rule for the "standard" visibility of the children.
To example the boolean operation with the not visible childs and the App::Part on the other side with the visible children.
What I mean, is the rule / information about the type of the object. Is it a completly new object, only built by the shape of the chlidren (boolean operation) or is the parent only a object for grouping object (App::Part).
I hope, now it is a bit more clear
usbhub
To example the boolean operation with the not visible childs and the App::Part on the other side with the visible children.
What I mean, is the rule / information about the type of the object. Is it a completly new object, only built by the shape of the chlidren (boolean operation) or is the parent only a object for grouping object (App::Part).
I hope, now it is a bit more clear
usbhub
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Visibility system in FreeCAD
It is built into command code, and I'm afraid there's no standard way of figuring it out.
for example, hiding the children is done by this line of code:
https://github.com/FreeCAD/FreeCAD/blob ... d.cpp#L516
for example, hiding the children is done by this line of code:
https://github.com/FreeCAD/FreeCAD/blob ... d.cpp#L516
Re: Visibility system in FreeCAD
Okay, too bad, then there's only the dirty way of a list that says what it's like with the corresponding object.DeepSOIC wrote: ↑Thu Oct 03, 2019 12:37 am It is built into command code, and I'm afraid there's no standard way of figuring it out.
for example, hiding the children is done by this line of code:
https://github.com/FreeCAD/FreeCAD/blob ... d.cpp#L516
But thanks anyway!