<html><head><title>Selection 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>Selection API</h1></div> <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><p>The selection submodule is part of the FreeCADGui module. Example: </p> <pre>import FreeCADGui sel = FreeCADGui.Selection.getSelection() </pre> <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>addSelection</b></big> ( <i>FreeCAD.Object</i> )</div> <div class="description"> <p><small><b>Description</b>:</small> Adds an object to the selection </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>clearSelection</b></big> ( <i>[string]</i> )</div> <div class="description"> <p><small><b>Description</b>:</small> Clears the selection of the given document name. If no document is given the complete selection is cleared. </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>getSelection</b></big> ( <i>[string]</i> )</div> <div class="description"> <p><small><b>Description</b>:</small> Returns a list of selected document objects for a given document name. If no document is given the complete selection is returned. </p><p><small><b>Returns</b>:</small> a list of document objects in the order they were selected. </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>getSelectionEx</b></big> ( <i>[string]</i> )</div> <div class="description"> <p><small><b>Description</b>:</small> Returns a list of SelectionObject for a given document name. If no document is given the complete selection is returned. Used for selecting subobjects (ex some Edges of a Face). </p><p><small><b>Returns</b>:</small> a list of SelectionObjects in the order they were selected </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>isSelected</b></big> ( <i>FreeCAD.Object</i> )</div> <div class="description"> <p><small><b>Description</b>:</small> Checks if a given object is selected </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>removeSelection</b></big> ( <i>FreeCAD.Object</i> )</div> <div class="description"> <p><small><b>Description</b>:</small> Removes an object from the selection </p><p><small><b>Returns</b>:</small> </p> </div> </div> <div style="clear:both"></div> </div> </div> </div><div class="printfooter"> Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=Selection_API&oldid=133209">http://www.freecadweb.org/wiki/index.php?title=Selection_API&oldid=133209</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>