Community
Hello,
AutoCAD 2011 (Civil) throw a "eNotApplicable"-Error (See Code). Why?
public static ObjectIdCollection GetSelection(string Layername, string TypeNames, AcadDocument FromThisDWG) { Document acDocument = Document.FromAcadDocument( FromThisDWG); Editor acEditor = acDocument.Editor; if (string.IsNullOrEmpty(Layername) && string.IsNullOrEmpty(TypeNames)) return null; if (!clLayer.HasLayer(Layername, FromThisDWG)) return null; TypedValue[] typedValue; if (string.IsNullOrEmpty(TypeNames)) { typedValue = new TypedValue[1] { new TypedValue((int)DxfCode.LayerName, Layername) }; } else { typedValue = new TypedValue[2] { new TypedValue((int)DxfCode.LayerName, Layername), new TypedValue((int)DxfCode.Start, TypeNames) }; } SelectionFilter selectionFilter = new SelectionFilter(typedValue); PromptSelectionResult acPromptSelectionResult = acEditor.SelectAll(selectionFilter); // === eNotApplicable-Error if (acPromptSelectionResult.Status == PromptStatus.OK) { return new ObjectIdCollection(acPromptSelectionResult.Value.GetObjectIds()); } return null; }
greets Mario
Try making the entity type names the first element in the array of TypedValues