one has to keep track of which objects one has at hand...
LastAngle is a property of the document object (App.ActiveDocument.Arc), not the shape curve (App.ActiveDocument.Arc.Shape.Curve) (see long script at end)
probably other selection scheme constructs works as well, but if you want to get hold of LastAngle, it is the document object that is needed (if you want it directly, can of course also go via Curve, but it is more elaborate).
sure, one can pick up any attribute dynamically (anytime, anywhere), sample constructs are...
Code: Select all
## exploring objects
>>> App.ActiveDocument.Arc
<Part::Part2DObject>
>>> App.ActiveDocument.Arc.LastAngle
116.56504903391658 deg
# selecting the arc in tree-view
>>> Gui.Selection.getSelection()
[<Part::Part2DObject>]
>>> Gui.Selection.getSelectionEx()[0]
<SelectionObject>
>>> Gui.Selection.getSelectionEx()[0].Object
<Part::Part2DObject>
>>> Gui.Selection.getSelectionEx()[0].SubObjects
()
# selecting the arc in 3d-view
>>> Gui.Selection.getSelection()
[<Part::Part2DObject>]
>>> Gui.Selection.getSelectionEx()[0].Object
<Part::Part2DObject>
>>> Gui.Selection.getSelectionEx()[0].SubObjects
(<Edge object at 0x55f0ede455b0>,)
>>> Gui.Selection.getSelectionEx()[0].SubObjects[0]
<Edge object at 0x55f0f6b6fd40>
>>> Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve
Circle (Radius : 19.7996, Position : (-7.50708, 6.65722, 0), Direction : (0, 0, 1))
>>> Gui.Selection.getSelectionEx()[0].Object is App.ActiveDocument.Arc
True
>>> Gui.Selection.getSelectionEx()[0].SubObjects[0] is App.ActiveDocument.Arc
False
>>> Gui.Selection.getSelectionEx()[0].SubObjects[0] is App.ActiveDocument.Arc.Shape
False ## hm...
>>> Gui.Selection.getSelectionEx()[0].SubObjects[0]
<Edge object at 0x7f8880022b70>
>>> Gui.Selection.getSelectionEx()[0].SubObjects[0]
<Edge object at 0x7f88800151e0>
>>> App.ActiveDocument.Arc.Shape
<Edge object at 0x7f88800226c0>
>>> App.ActiveDocument.Arc.Shape
<Edge object at 0x7f88800166d0>
# so new objects and thus id's are created every time called...
# so a different route is needed to check if they contain the same..
# for simplicity, check content...
>>> Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve.Content
'<GeoExtensions count="0">\n</GeoExtensions>\n<Circle CenterX="-7.50708" CenterY="6.65722" CenterZ="0" NormalX="0" NormalY="0" NormalZ="1" AngleXU="-0" Radius="19.7996"/>\n'
>>> App.ActiveDocument.Arc.Shape.Curve.Content
'<GeoExtensions count="0">\n</GeoExtensions>\n<Circle CenterX="-7.50708" CenterY="6.65722" CenterZ="0" NormalX="0" NormalY="0" NormalZ="1" AngleXU="-0" Radius="19.7996"/>\n'
# well, at least same content...
>>> dir(Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve)
['AngleXU', 'Axis', 'Center', 'Content', 'Continuity', 'Eccentricity', 'FirstParameter', 'LastParameter', 'Location', 'MemSize', 'Module', 'Radius', 'Rotation', 'Tag', 'TypeId', 'XAxis', 'YAxis', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'approximateBSpline', 'centerOfCurvature', 'clone', 'continuityWith', 'copy', 'curvature', 'deleteExtensionOfName', 'deleteExtensionOfType', 'discretize', 'dumpContent', 'getAllDerivedFrom', 'getD0', 'getD1', 'getD2', 'getD3', 'getDN', 'getExtensionOfName', 'getExtensionOfType', 'getExtensions', 'hasExtensionOfName', 'hasExtensionOfType', 'intersect', 'intersect2d', 'intersectCC', 'intersectCS', 'isClosed', 'isDerivedFrom', 'isPeriodic', 'length', 'makeRuledSurface', 'mirror', 'normal', 'parameter', 'parameterAtDistance', 'period', 'restoreContent', 'reverse', 'reversedParameter', 'rotate', 'scale', 'setExtension', 'tangent', 'toBSpline', 'toNurbs', 'toShape', 'transform', 'translate', 'trim', 'value']
>>> 'LastAngle' in dir(Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve)
False
>>> dir(App.ActiveDocument.Arc)
['Area', 'Attacher', 'AttacherType', 'AttachmentOffset', 'Content', 'Document', 'ExpressionEngine', 'FirstAngle', 'FullName', 'ID', 'InList', 'InListRecursive', 'Label', 'Label2', 'LastAngle', 'MakeFace', 'MapMode', 'MapPathParameter', 'MapReversed', 'MemSize', 'Module', 'MustExecute', 'Name', 'NoTouch', 'OldLabel', 'OutList', 'OutListRecursive', 'Parents', 'Placement', 'PropertiesList', 'Proxy', 'Radius', 'Removing', 'Shape', 'State', 'Support', 'TypeId', 'ViewObject', 'Visibility', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'addExtension', 'addProperty', 'adjustRelativeLinks', 'changeAttacherType', 'clearExpression', 'dumpContent', 'dumpPropertyContent', 'enforceRecompute', 'evalExpression', 'getAllDerivedFrom', 'getDocumentationOfProperty', 'getEditorMode', 'getEnumerationsOfProperty', 'getGlobalPlacement', 'getGroupOfProperty', 'getLinkedObject', 'getParentGeoFeatureGroup', 'getParentGroup', 'getPaths', 'getPathsByOutList', 'getPropertyByName', 'getPropertyNameOfGeometry', 'getPropertyOfGeometry', 'getPropertyStatus', 'getPropertyTouchList', 'getStatusString', 'getSubObject', 'getSubObjectList', 'getSubObjects', 'getTypeIdOfProperty', 'getTypeOfProperty', 'hasChildElement', 'hasExtension', 'isDerivedFrom', 'isElementVisible', 'isValid', 'positionBySupport', 'purgeTouched', 'recompute', 'removeProperty', 'resolve', 'resolveSubElement', 'restoreContent', 'restorePropertyContent', 'setDocumentationOfProperty', 'setEditorMode', 'setElementVisible', 'setExpression', 'setGroupOfProperty', 'setPropertyStatus', 'supportedProperties', 'touch']
>>> 'LastAngle' in dir(App.ActiveDocument.Arc)
True