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 |
Beta Was this translation helpful? Give feedback.
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)
|
Beta Was this translation helpful? Give feedback.
7 replies
-
should be good, I deleted my requirement to not use exceptions for code flow, I guess it's pretty common in python. |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Db.BlockTable.__getitem__()
raisesPyDb.ErrorStatusException(eKeyNotFound)
while the getitem methods should throwKeyError
orIndexError
(in this caseKeyError
). This would be easier to use and more intuitive. Is this possible?Beta Was this translation helpful? Give feedback.
All reactions