.NET

.NET

Reply
Active Contributor
sdphg
Posts: 28
Registered: ‎05-21-2008
Message 1 of 3 (453 Views)
Accepted Solution

How to bring an entity to front, just like the commond "DR" do?

453 Views, 2 Replies
01-24-2011 05:44 AM

I want to bring an entity to front using .net, just like the command "DR",any suggestions? THX.

Look up Autodesk.AutoCAD.DatabaseServices.DrawTable class, which have methods: MoveAbove()/MoveBelow()/MoveToTop()/MoveToBottom().

 

You get to DrawOrderTable via WorkingDatabase.DrawOrderTableId.

*Expert Elite*
norman.yuan
Posts: 1,064
Registered: ‎04-27-2009
Message 2 of 3 (443 Views)

Re: How to bring an entity to front, just like the commond "DR" do?

01-24-2011 06:33 AM in reply to: sdphg

Look up Autodesk.AutoCAD.DatabaseServices.DrawTable class, which have methods: MoveAbove()/MoveBelow()/MoveToTop()/MoveToBottom().

 

You get to DrawOrderTable via WorkingDatabase.DrawOrderTableId.

Active Contributor
sdphg
Posts: 28
Registered: ‎05-21-2008
Message 3 of 3 (395 Views)

Re: How to bring an entity to front, just like the commond "DR" do?

01-26-2011 02:16 AM in reply to: norman.yuan

thank you norman, your suggestion is very useful.

I make some change to get the DrawOrderTable, because I can't get the DrawOrderTableId from the WorkingDatabase, my code is  below: 

 

 
BlockTable bt = tr.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
BlockTableRecord btr = tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead) as BlockTableRecord;
DBDictionary dbo = tr.GetObject(btr.ExtensionDictionary, OpenMode.ForRead) as DBDictionary;
DrawOrderTable dot = tr.GetObject((ObjectId)dbo["ACAD_SORTENTS"] , OpenMode.ForWrite) as DrawOrderTable;

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.