Code: Select all
>>> obj.getAllDerivedFrom()
['Part::FeaturePython']
Or:
Code: Select all
>>> box.isDerivedFrom("Part::Primitive")
True
Code: Select all
>>> obj.getAllDerivedFrom()
['Part::FeaturePython']
Code: Select all
>>> box.isDerivedFrom("Part::Primitive")
True
But if create Part::Sphere in Part worckbench. Select it and run. Method is return:Roy_043 wrote: ↑Thu Sep 09, 2021 4:47 pm Hmm...Seems useful to me... (obj is Draft_PolarArray).Code: Select all
>>> obj.getAllDerivedFrom() ['Part::FeaturePython']
Or:
Code: Select all
>>> box.isDerivedFrom("Part::Primitive") True
Code: Select all
sel = FreeCADGui.Selection.getSelection()
obj = FreeCAD.ActiveDocument.getObject(sel[0].Name)
obj.getAllDerivedFrom()
>>> ['Part::Sphere']
Code: Select all
sel = FreeCADGui.Selection.getSelection()
obj = FreeCAD.ActiveDocument.getObject(sel[0].Name)
obj.getAllDerivedFrom()
>>> ['Part::FeaturePython']
Hi,Roy_043 wrote: ↑Fri Sep 10, 2021 9:30 am Note that the solution adopted in Macro_Wiki_Object_Properties_List_Generator is problematic. F.e. a Draft_Text does not inherit the Placement property, but your code will identify it as such.
Code: Select all
10:28:25
==Properties==
10:28:25
===View===
10:28:25
<!--
DisplayMode inherited from classPartDesign::Body
LineColor inherited from classPartDesign::Body
LineWidth inherited from classPartDesign::Body
OnTopWhenSelected inherited from classPartDesign::Body
SelectionStyle inherited from classPartDesign::Body
ShowInTree inherited from classPartDesign::Body
Visibility inherited from classPartDesign::Body
-->
10:28:25
* {{PropertyView|Proxy|PythonObject}}:
10:28:25
{{TitleProperty|Annotation}}
10:28:25
* {{PropertyView|AnnotationStyle|Enumeration}}: Annotation style to apply to this object.
When using a saved style some of the view properties will become read-only;
they will only be editable by changing the style through the 'Annotation style editor' tool.
10:28:25
* {{PropertyView|ScaleMultiplier|Float}}: General scaling factor that affects the annotation consistently
because it scales the text, and the line decorations, if any,
in the same proportion.
10:28:25
{{TitleProperty|Text}}
10:28:25
* {{PropertyView|FontName|Font}}: The font of the text
10:28:25
* {{PropertyView|FontSize|Length}}: The size of the text
10:28:25
* {{PropertyView|Justification|Enumeration}}: The vertical alignment of the text
10:28:25
* {{PropertyView|LineSpacing|Float}}: Line spacing (relative to font size)
10:28:25
* {{PropertyView|TextColor|Color}}: Text color
10:28:25
===Data===
10:28:25
<!--
ExpressionEngine inherited from classPartDesign::Body
Label inherited from classPartDesign::Body
Label2 inherited from classPartDesign::Body
Placement inherited from classPartDesign::Body
Visibility inherited from classPartDesign::Body
-->
10:28:25
* {{PropertyData|Proxy|PythonObject}}:
10:28:25
{{TitleProperty|Base}}
10:28:25
* {{PropertyData|Text|StringList}}: The text displayed by this object.
It is a list of strings; each element in the list will be displayed in its own line.
You have created at least 4 pages and one template while experimenting with this. Some of them can be deleted I think.Evgeniy wrote:Ping
After this comment I am even more worried than I was before.