Draw order
#241
Replies: 3 comments 9 replies
-
from pyrx import Rx, Ge, Gi, Db, Ap, Ed, Ax, command
@command
def doit():
db = Db.curDb()
ps1, id1, _ = Ed.Editor.entSel("\nSelect\n")
ps2, id2, _ = Ed.Editor.entSel("\nSelect\n")
idmap = {}
idmap[id1] = "first"
idmap[id2] = "second"
model = Db.BlockTableRecord(db.modelSpaceId())
sortEnts = model.getSortentsTable(Db.OpenMode.kForWrite, True)
sortEnts.swapOrder(id1, id2)
for item in sortEnts.getFullDrawOrder(1):
print(idmap[item])
sortEnts.swapOrder(id1, id2)
for item in sortEnts.getFullDrawOrder(1):
print(idmap[item])
sortEnts.moveToTop([id1])
sortEnts.moveToBottom([id2])
for item in sortEnts.getFullDrawOrder(1):
print(idmap[item])
sortEnts.moveToTop([id2])
sortEnts.moveToBottom([id1])
for item in sortEnts.getFullDrawOrder(1):
print(idmap[item]) |
Beta Was this translation helpful? Give feedback.
2 replies
-
Ax from pyrx import Rx, Ge, Gi, Db, Ap, Ed, Ax, command
@command
def doitx():
axApp = Ap.Application.acadApplication()
axDoc = axApp.activeDocument()
axModel = axDoc.modelSpace()
ex = axModel.extensionDictionary()
dicts = [i.objectName() for i in ex.items()]
if not "AcDbSortentsTable" in dicts:
ex.addObject("ACAD_SORTENTS", "AcDbSortentsTable")
axSortEnts = Ax.AcadSortentsTable.cast(ex.object("ACAD_SORTENTS"))
ps1, id1, _ = Ed.Editor.entSel("\nSelect\n")
ps2, id2, _ = Ed.Editor.entSel("\nSelect\n")
axEnt1 = Ax.AcadEntity.cast(id1.acadObject())
axEnt2 = Ax.AcadEntity.cast(id2.acadObject())
idmap = {}
idmap[axEnt1] = "first"
idmap[axEnt2] = "second"
for item in axSortEnts.fullDrawOrder(True):
print(idmap[item])
axSortEnts.swapOrder(axEnt1, axEnt2)
for item in axSortEnts.fullDrawOrder(True):
print(idmap[item])
axSortEnts.moveToTop([axEnt1])
axSortEnts.moveToBottom([axEnt2])
for item in axSortEnts.fullDrawOrder(True):
print(idmap[item])
axSortEnts.moveToTop([axEnt2])
axSortEnts.moveToBottom([axEnt1])
for item in axSortEnts.fullDrawOrder(True):
print(idmap[item]) |
Beta Was this translation helpful? Give feedback.
0 replies
-
from pyrx import Db, command
@command
def doit():
db = Db.curDb()
model = Db.BlockTableRecord(db.modelSpaceId())
sortEnts = model.getSortentsTable(Db.OpenMode.kForWrite, True)
sortEnts.moveToBottom([])
|
Beta Was this translation helpful? Give feedback.
7 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.
-
I think I know how to change the drawing order in ActiveX, but how do I do it in ARX?
Beta Was this translation helpful? Give feedback.
All reactions