See the Editor's SelectionAdded Event and look at this newsgroup for
samples.
--
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
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
wrote in message news:6192371@discussion.autodesk.com...
Can any one tell me how to prevent layer object from selecting using c#. I
am using the following c# code public static void Remove
selection(StringBuilder szLayer) { ObjectId objId = new ObjectId(); Database
db = HostApplicationServices.WorkingDatabase; using (Transaction trans =
db.TransactionManager.StartTransaction()) { LayerTable layerTable =
(LayerTable)trans.GetObject(db.LayerTableId, OpenMode.ForRead); string
Layername = szLayer.ToString(); foreach (ObjectId obj in layerTable) { if
((layerTable.Has(Layername)) && layerTable[Layername] != db.Clayer) { objId
= layerTable[Layername]; } } if (objId != null) { Editor ed =
Application.DocumentManager.MdiActiveDocument.Editor; PromptSelectionResult
psrres = ed.GetSelection(); SelectionSet psr = psrres.Value; if (psr.Count >
0) { for (int i = 0; i <= psr.Count; i++) { if (psr.ObjectId == objId)
{ ----> how to remove the given layer from selection } } } } Edited by:
shamsam1 on May 30, 2009 1:05 PM