173 lines
7.6 KiB
HTML
173 lines
7.6 KiB
HTML
<html><head><title>Object API</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type='text/css' href='wiki.css' rel='stylesheet'></head><body><h1>Object API</h1></div>
|
|
|
|
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><p>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:
|
|
</p>
|
|
<pre>myObj = FreeCAD.ActiveDocument.myObjectName
|
|
print myObj.PropertiesList </pre>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Property.png" class="image"><img alt="Property.png" src="Property.png" width="16" height="16" /></a> <big><b>Content</b></big></div>
|
|
<div class="description">
|
|
<p><small><b>Returns</b>:</small> An XML representation of the properties of an object.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Property.png" class="image"><img alt="Property.png" src="Property.png" width="16" height="16" /></a> <big><b>Label</b></big></div>
|
|
<div class="description">
|
|
<p><small><b>Returns</b>:</small> Gets/sets the objects label. The string can be unicode.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Property.png" class="image"><img alt="Property.png" src="Property.png" width="16" height="16" /></a> <big><b>Name</b></big></div>
|
|
<div class="description">
|
|
<p><small><b>Returns</b>:</small> The unique name of an object.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Property.png" class="image"><img alt="Property.png" src="Property.png" width="16" height="16" /></a> <big><b>Placement</b></big></div>
|
|
<div class="description">
|
|
<p><small><b>Returns</b>:</small> 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.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Property.png" class="image"><img alt="Property.png" src="Property.png" width="16" height="16" /></a> <big><b>PropertiesList</b></big></div>
|
|
<div class="description">
|
|
<p><small><b>Returns</b>:</small> A list of the properties of an object
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Property.png" class="image"><img alt="Property.png" src="Property.png" width="16" height="16" /></a> <big><b>State</b></big></div>
|
|
<div class="description">
|
|
<p><small><b>Returns</b>:</small> The FreeCAD state of an object (ie. if it needs to be recomputed)
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Property.png" class="image"><img alt="Property.png" src="Property.png" width="16" height="16" /></a> <big><b>Type</b></big></div>
|
|
<div class="description">
|
|
<p><small><b>Returns</b>:</small> A string describing the type of an object
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Property.png" class="image"><img alt="Property.png" src="Property.png" width="16" height="16" /></a> <big><b>ViewObject</b></big></div>
|
|
<div class="description">
|
|
<p><small><b>Returns</b>:</small> The associated View Provider (FreeCADGUI object) of an object
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Method.png" class="image"><img alt="Method.png" src="Method.png" width="16" height="16" /></a> <big><b>getAllDerivedFrom</b></big> ( <i> </i> )</div>
|
|
<div class="description">
|
|
<p><small><b>Description</b>:</small>
|
|
</p><p><small><b>Returns</b>:</small> All descendants of this object
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Method.png" class="image"><img alt="Method.png" src="Method.png" width="16" height="16" /></a> <big><b>getDocumentationOfProperty</b></big> ( <i> </i> )</div>
|
|
<div class="description">
|
|
<p><small><b>Description</b>:</small>
|
|
</p><p><small><b>Returns</b>:</small> The documentation string of the property of this class.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Method.png" class="image"><img alt="Method.png" src="Method.png" width="16" height="16" /></a> <big><b>getGroupOfProperty</b></big> ( <i> </i> )</div>
|
|
<div class="description">
|
|
<p><small><b>Description</b>:</small>
|
|
</p><p><small><b>Returns</b>:</small> The name of the group which the property belongs to in this class. The properties are sorted in different named groups for convenience.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Method.png" class="image"><img alt="Method.png" src="Method.png" width="16" height="16" /></a> <big><b>getPropertyByName</b></big> ( <i> </i> )</div>
|
|
<div class="description">
|
|
<p><small><b>Description</b>:</small>
|
|
</p><p><small><b>Returns</b>:</small> The value of a named property.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Method.png" class="image"><img alt="Method.png" src="Method.png" width="16" height="16" /></a> <big><b>getTypeOfProperty</b></big> ( <i> </i> )</div>
|
|
<div class="description">
|
|
<p><small><b>Description</b>:</small>
|
|
</p><p><small><b>Returns</b>:</small> The type of a named property. This can be (Hidden,ReadOnly,Output) or any combination.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Method.png" class="image"><img alt="Method.png" src="Method.png" width="16" height="16" /></a> <big><b>isDerivedFrom</b></big> ( <i> </i> )</div>
|
|
<div class="description">
|
|
<p><small><b>Description</b>:</small>
|
|
</p><p><small><b>Returns</b>:</small> True if given type is a father
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Method.png" class="image"><img alt="Method.png" src="Method.png" width="16" height="16" /></a> <big><b>purgeTouched</b></big> ( <i> </i> )</div>
|
|
<div class="description">
|
|
<p><small><b>Description</b>:</small> Marks the object as unchanged
|
|
</p><p><small><b>Returns</b>:</small>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<p><br />
|
|
</p>
|
|
<div class="api">
|
|
<div class="function"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Method.png" class="image"><img alt="Method.png" src="Method.png" width="16" height="16" /></a> <big><b>touch</b></big> ( <i> </i> )</div>
|
|
<div class="description">
|
|
<p><small><b>Description</b>:</small> Marks the object as changed (touched)
|
|
</p><p><small><b>Returns</b>:</small>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div><div class="printfooter">
|
|
Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=Object_API&oldid=133204">http://www.freecadweb.org/wiki/index.php?title=Object_API&oldid=133204</a>"</div>
|
|
<div id="catlinks" class="catlinks" data-mw="interface"></div><div class="visualClear"></div>
|
|
</div>
|
|
</div>
|
|
<div id="mw-navigation">
|
|
<h2>Navigation menu</h2>
|
|
|
|
</body></html> |