Public Member Functions | |
| def | execute (self, obj) |
| def | onChanged (self, obj, prop) |
Public Attributes | |
| Type | |
The base class for Draft objects.
Parameters
----------
obj : a base C++ object
The base object instantiated during creation,
which commonly may be of types `Part::Part2DObjectPython`,
`Part::FeaturePython`, or `App::FeaturePython`.
>>> obj = App.ActiveDocument.addObject('Part::Part2DObjectPython')
>>> DraftObject(obj)
This class instance is stored in the `Proxy` attribute
of the base object.
::
obj.Proxy = self
tp : str, optional
It defaults to `'Unknown'`.
It indicates the type of this scripted object,
which will be assigned to the Proxy's `Type` attribute.
This is useful to distinguish different types of scripted objects
that may be derived from the same C++ class.
Attributes
----------
Type : str
It indicates the type of scripted object.
Normally `Type = tp`.
All objects have a `TypeId` attribute, but this attribute
refers to the C++ class only. Using the `Type` attribute
allows distinguishing among various types of objects
derived from the same C++ class.
>>> print(A.TypeId, "->", A.Proxy.Type)
Part::Part2DObjectPython -> Wire
>>> print(B.TypeId, "->", B.Proxy.Type)
Part::Part2DObjectPython -> Circle
This class attribute is accessible through the `Proxy` object:
`obj.Proxy.Type`.
| def draftobjects.base.DraftObject.execute | ( | self, | |
| obj | |||
| ) |
Run this method when the object is created or recomputed.
Override this method to produce effects when the object
is newly created, and whenever the document is recomputed.
By default it does nothing.
Parameters
----------
obj : the scripted object.
This commonly may be of types `Part::Part2DObjectPython`,
`Part::FeaturePython`, or `App::FeaturePython`.
Reimplemented in draftobjects.bezcurve.BezCurve, draftobjects.array.Array, draftobjects.block.Block, draftobjects.bspline.BSpline, draftobjects.circle.Circle, draftobjects.clone.Clone, draftobjects.drawingview.DrawingView, draftobjects.ellipse.Ellipse, draftobjects.facebinder.Facebinder, draftobjects.fillet.Fillet, draftobjects.patharray.PathArray, draftobjects.pathtwistedarray.PathTwistedArray, draftobjects.point.Point, draftobjects.pointarray.PointArray, draftobjects.polygon.Polygon, draftobjects.rectangle.Rectangle, draftobjects.shape2dview.Shape2DView, draftobjects.shapestring.ShapeString, and draftobjects.wire.Wire.
Referenced by draftobjects.facebinder.Facebinder.addSubobjects(), PathScripts.PathDressupDogbone.ObjectDressup.boneStateList(), ArchSite.Compass.buildCoordinates(), PathScripts.PathDressupHoldingTags.ObjectTagDressup.generateTags(), ArchPanel.PanelCut.getWires(), ArchSchedule.CommandArchSchedule.IsActive(), Mod.PartDesign.Scripts.DistanceBolt.DistanceBolt.onChanged(), Mod.PartDesign.Scripts.Epitrochoid.Epitrochoid.onChanged(), Mod.PartDesign.Scripts.Parallelepiped.Parallelepiped.onChanged(), Mod.PartDesign.Scripts.Parallelepiped.BoxCylinder.onChanged(), Mod.PartDesign.Scripts.Spring.MySpring.onChanged(), FeaturePython.DistanceBolt.onChanged(), PathScripts.PathStock.StockFromBase.onChanged(), PathScripts.PathStock.StockCreateBox.onChanged(), PathScripts.PathStock.StockCreateCylinder.onChanged(), draftobjects.draftlink.DraftLink.onDocumentRestored(), draftobjects.patharray.PathArray.onDocumentRestored(), and draftobjects.pathtwistedarray.PathTwistedArray.onDocumentRestored().
| def draftobjects.base.DraftObject.onChanged | ( | self, | |
| obj, | |||
| prop | |||
| ) |
Run this method when a property is changed.
Override this method to handle the behavior
of the object depending on changes that occur to its properties.
By default it does nothing.
Parameters
----------
obj : the scripted object.
This commonly may be of types `Part::Part2DObjectPython`,
`Part::FeaturePython`, or `App::FeaturePython`.
prop : str
Name of the property that was modified.
Reimplemented in draftobjects.bezcurve.BezCurve, draftobjects.bspline.BSpline, draftobjects.array.Array, draftobjects.draftlink.DraftLink, draftobjects.fillet.Fillet, draftobjects.patharray.PathArray, draftobjects.pathtwistedarray.PathTwistedArray, and draftobjects.wire.Wire.
Referenced by ArchStructure.CommandStructuralSystem.Activated(), draftviewproviders.view_base.ViewProviderDraft.attach(), ArchSite.Compass.buildCoordinates(), draftobjects.wire.Wire.execute(), ArchBuildingPart.ViewProviderBuildingPart.updateData(), ArchPanel.ViewProviderPanelCut.updateData(), ArchPanel.ViewProviderPanelSheet.updateData(), draftviewproviders.view_label.ViewProviderLabel.updateData(), draftviewproviders.view_layer.ViewProviderLayer.updateData(), and draftviewproviders.view_wpproxy.ViewProviderWorkingPlaneProxy.updateData().
| draftobjects.base.DraftObject.Type |
Referenced by ArchPanel.CommandPanelSheet.Activated(), ArchStructure.CommandStructuralSystem.Activated(), draftobjects.draft_annotation.DraftAnnotation.add_missing_properties_0v19(), ArchStructure.StructSelectionObserver.addSelection(), ArchSite.Compass.buildCoordinates(), ArchComponent.Component.execute(), draftobjects.layer.LayerContainer.execute(), ArchSchedule.CommandArchSchedule.IsActive(), draftobjects.layer.Layer.set_properties(), and ArchReference.ArchReference.setProperties().