.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eNotApplicable-Error on Editor.SelectAll function

1 REPLY 1
Reply
Message 1 of 2
mario.rosenbohm
1187 Views, 1 Reply

eNotApplicable-Error on Editor.SelectAll function

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

1 REPLY 1
Message 2 of 2
caddzone
in reply to: mario.rosenbohm

Try making the entity type names the first element in the array of TypedValues



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost