Replies: 3 comments 12 replies
|
eKeyNotFound is generated from ARX, Acad::eKeyNotFound, if we change it, then users would not be able to search for similar conditions |
5 replies
|
works from pyrx import Ap, Ax, Db, Ge
@Ap.Command()
def doit():
try:
db = Db.curDb()
bt = Db.BlockTable(db.blockTableId())
try:
btr_id = bt["block_name"]
except KeyError as e:
print("Block not found", e)
except Exception as err:
print(err)
|
7 replies
|
should be good, I deleted my requirement to not use exceptions for code flow, I guess it's pretty common in python. |
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.
Uh oh!
There was an error while loading. Please reload this page.
Db.BlockTable.__getitem__()raisesPyDb.ErrorStatusException(eKeyNotFound)while the getitem methods should throwKeyErrororIndexError(in this caseKeyError). This would be easier to use and more intuitive. Is this possible?All reactions