-
Excuse me, does |
Beta Was this translation helpful? Give feedback.
Answered by
CEXT-Dan
Jun 26, 2025
Replies: 2 comments 3 replies
-
Oh, I missed that. I will add it. here is one possible workaround import traceback
from pyrx import Ap, Ax, Ed, Db
def getRegionArea(regionId: Db.ObjectId):
if not regionId.isDerivedFrom(Db.Region.desc()):
raise RuntimeError("Not a Region!: ")
axRegion = Ax.AcadRegion.cast(regionId.acadObject())
return axRegion.area()
@Ap.Command()
def doit() -> None:
try:
ps, id, _ = Ed.Editor.entSel("\nPick a region", Db.Region.desc())
if ps != Ed.PromptStatus.eOk:
raise RuntimeError("Selection Error! {}: ".format(ps))
area = getRegionArea(id)
print("Area = ",area)
except Exception as err:
traceback.print_exception(err) |
Beta Was this translation helpful? Give feedback.
2 replies
-
I added a refresh build to the repository import traceback
from pyrx import Ap, Ax, Ed, Db
@Ap.Command()
def doit() -> None:
try:
ps, id, _ = Ed.Editor.entSel("\nPick a region", Db.Region.desc())
if ps != Ed.PromptStatus.eOk:
raise RuntimeError("Selection Error! {}: ".format(ps))
region = Db.Region(id)
print("Area = ", region.getArea())
except Exception as err:
traceback.print_exception(err) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
royccg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added a refresh build to the repository