Replies: 2 comments 1 reply
-
Hi, depending on the context, it’s probably easier to use Ax space to do this, see if this sample works for you import traceback
from pyrx import Rx, Ge, Gi, Db, Ap, Ed, Ax
@Ap.Command()
def doit() -> None:
try:
axapp = Ap.Application.acadApplication()
ps, id, _ = Ed.Editor.entSel("\nSelect: ")
if ps != Ed.PromptStatus.eOk:
raise RuntimeError("Selection Error! {}: ".format(ps))
ent = Db.Entity(id)
ext = ent.getGeomExtents()
v = ext.maxPoint() - ext.minPoint()
axapp.zoomCenter(ext.midPoint(),v.length() )
except Exception as err:
traceback.print_exception(err) edit, there's no |
Beta Was this translation helpful? Give feedback.
1 reply
-
I added Ed.Core.getCurrentView(), it will be available in the next release |
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.
-
Dear all,
thanks for this opensource.
I'm trying to realize a function about being able to focus on a specified primitive.
As follow:
I asked chatgpt about the way to realize the above functions with c# as follow:
I haven't found a similar api about
Ed.GetCurrentView()
at the moment.Beta Was this translation helpful? Give feedback.
All reactions