Delete Object SelectionΒΆ

Simple example that iterates over the selected items in the current document and deletes them.

# Import the smile module
import litho.smile as ls
import litho.core as lc

# get the current document
doc = ls.mainWindow().currentDocument.document;

# make actions undoable
rec = doc.createRecorder()

#get the selected objects
sel = doc.selection.items(lc.selection.Type.Transforms)

#delete all groups
for item in sel:
	if item.isPath:
		print('Deleting :'+item.path.top.niceName)
		item.path.top.forceDelete()

rec.finish();