Description of how to generate an API script from a selection in Schematic Editor.
Generating a script
In Schematic Editor, an API script can be
generated from selection of components. By clicking the
Generate script from selection
option on the right-click menu (Figure 1),
the generated code is copied to the clipboard.
Figure 1. Right-click menu option
def delete_created_inner_components():
#
# Remove created components from parent
#
item_names = ["R1", "R2", "R3", "Junction1", "Junction2", "P2", "Electric Tag1", "Connection1", "Connection3", "Connection8", "Connection4", "Connection6", "Connection7", "Connection9"]
for item_name in item_names:
if mdl.exists(item_name, parent=parent):
handle = mdl.get_item(item_name, parent=parent)
mdl.delete_item(handle)
Removing all internal components function
def delete_all_inner_components():
#
# Remove all components from parent
#
for connection in mdl.get_items(parent=parent, item_type=ITEM_CONNECTION):
mdl.delete_item(connection)
for junction in mdl.get_items(parent=parent, item_type=ITEM_JUNCTION):
mdl.delete_item(junction)
for component in mdl.get_items(parent=parent, item_type=ITEM_COMPONENT):
mdl.delete_item(component)
for item in mdl.get_items(parent=parent):
mdl.delete_item(item)