For future reference, many here that use newsreaders
cannot easily look at code posted via the web, with or
without the code tags.
My advice is if you want the most possible responses,
that you attach your code in a .txt file.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com
Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm
wrote in message news:6146620@discussion.autodesk.com...
hello everyone, I made an app in C# to draw boring (soil exploration)
graphics, well, it was made to Land 06, but now, we want to use it in Civil
3d 09, but I encountered several compatibility problems in the code. That
is, the code used for deleting entities on determinated layer does not work
now, but thats not the only code that is not working, also the code for
delete layer, code for hiding the layer, code for showing the layer and so
on. So, I was wondering if you guys can help me with this problem. Here is
the code used for deleting entities (works fine in Land06): public void
DeleteLayerEntities(string layer) { Document doc =
Application.DocumentManager.MdiActiveDocument; Database db = doc.Database;
Editor ed = doc.Editor; Transaction tr =
db.TransactionManager.StartTransaction(); TypedValue[] tV = new
TypedValue[1]; tV[0] = new TypedValue((int)DxfCode.LayerName, layer);
SelectionFilter selectionFilter = new SelectionFilter(tV);
PromptSelectionResult promptSelectionResult = ed.SelectAll(selectionFilter);
try { DocumentLock mLock =
Application.DocumentManager.MdiActiveDocument.LockDocument(); foreach
(ObjectId id in promptSelectionResult.Value.GetObjectIds()) { Entity entity
= (Entity)tr.GetObject(id, OpenMode.ForWrite); entity.UpgradeOpen();
entity.Erase(); entity.Dispose(); } UpdateScreen(); mLock.Dispose();
tr.Commit(); } catch (System.NullReferenceException) { ;} }