Object API/it: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 4: Line 4:
print myObj.PropertiesList
print myObj.PropertiesList


{{APIProperty|Content|an XML representation of the properties of an object.}}
{{APIProperty|Content|An XML representation of the properties of an object.}}
{{APIProperty|Label|Gets/sets the objects label. The string can be unicode.}}
{{APIProperty|Label|Gets/sets the objects label. The string can be unicode.}}
{{APIProperty|Name|the unique name of an object.}}
{{APIProperty|Name|The unique name of an object.}}
{{APIProperty|Placement|Gets/sets the Placement of an object. A placement defines an orientation (rotation) and a position (base) in 3D space. It is used when no scaling or other distortion is needed.}}
{{APIProperty|Placement|Gets/sets the Placement of an object. A placement defines an orientation (rotation) and a position (base) in 3D space. It is used when no scaling or other distortion is needed.}}
{{APIProperty|PropertiesList|a list of the properties of an object}}
{{APIProperty|PropertiesList|A list of the properties of an object}}
{{APIProperty|State|the FreeCAD state of an object (ie. if it needs to be recomputed)}}
{{APIProperty|State|The FreeCAD state of an object (ie. if it needs to be recomputed)}}
{{APIProperty|Type|a string describing the type of an object}}
{{APIProperty|Type|A string describing the type of an object}}
{{APIProperty|ViewObject|the associated View Provider (FreeCADGUI object) of an object}}
{{APIProperty|ViewObject|The associated View Provider (FreeCADGUI object) of an object}}
{{APIFunction|getAllDerivedFrom| | |all descentences of this object}}
{{APIFunction|getAllDerivedFrom| | |All descendants of this object}}
{{APIFunction|getDocumentationOfProperty| | |the documentation string of the property of this class.}}
{{APIFunction|getDocumentationOfProperty| | |The documentation string of the property of this class.}}
{{APIFunction|getGroupOfProperty| | |the name of the group which the property belongs to in this class. The properties sorted in differnt named groups for convenience.}}
{{APIFunction|getGroupOfProperty| | |The name of the group which the property belongs to in this class. The properties are sorted in different named groups for convenience.}}
{{APIFunction|getPropertyByName| | |the value of a named property.}}
{{APIFunction|getPropertyByName| | |The value of a named property.}}
{{APIFunction|getTypeOfProperty| | |the type of a named property. This can be (Hidden,ReadOnly,Output) or any combination.}}
{{APIFunction|getTypeOfProperty| | |The type of a named property. This can be (Hidden,ReadOnly,Output) or any combination.}}
{{APIFunction|isDerivedFrom| | |True if given type is a father}}
{{APIFunction|isDerivedFrom| | |True if given type is a father}}
{{APIFunction|purgeTouched| |Marks the object as unchanged| }}
{{APIFunction|purgeTouched| |Marks the object as unchanged| }}

Revision as of 03:21, 28 September 2014

Being parametric, document objects in FreeCAD can have a lot of additional properties, but these are the basic ones, present in every FreeCAD Document Object. Objects can be retrieved simply by their name. Example:

myObj = FreeCAD.ActiveDocument.myObjectName
print myObj.PropertiesList
Content

Returns: An XML representation of the properties of an object.

Label

Returns: Gets/sets the objects label. The string can be unicode.

Name

Returns: The unique name of an object.

Placement

Returns: Gets/sets the Placement of an object. A placement defines an orientation (rotation) and a position (base) in 3D space. It is used when no scaling or other distortion is needed.

PropertiesList

Returns: A list of the properties of an object

State

Returns: The FreeCAD state of an object (ie. if it needs to be recomputed)

Type

Returns: A string describing the type of an object

ViewObject

Returns: The associated View Provider (FreeCADGUI object) of an object

getAllDerivedFrom( )

Description:

Returns: All descendants of this object

getDocumentationOfProperty( )

Description:

Returns: The documentation string of the property of this class.

getGroupOfProperty( )

Description:

Returns: The name of the group which the property belongs to in this class. The properties are sorted in different named groups for convenience.

getPropertyByName( )

Description:

Returns: The value of a named property.

getTypeOfProperty( )

Description:

Returns: The type of a named property. This can be (Hidden,ReadOnly,Output) or any combination.

isDerivedFrom( )

Description:

Returns: True if given type is a father

purgeTouched( )

Description: Marks the object as unchanged

Returns:

touch( )

Description: Marks the object as changed (touched)

Returns:

Other languages: