Replies: 1 comment
-
|
Hi, you would open the entity from the object id, then call erase import traceback
from pyrx import Ap, Db, Ed, Ge
# note erase requires the entity to be opened for write
# using a helper function is a good way to add a scope for garbage collection
def eraseEntities(ids : list[Db.ObjectId]):
for id in ids:
ent = Db.Entity(id, Db.OpenMode.kForWrite)
ent.erase()
@Ap.Command()
def doit0():
try:
ps, ss = Ed.Editor.select()
if ps != Ed.PromptStatus.eNormal:
return
line_ids = ss.objectIds(Db.Line.desc())
eraseEntities(line_ids)
except Exception:
traceback.print_exc() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
how to delete entities after user selecting them?
Beta Was this translation helpful? Give feedback.
All reactions