[using System;
using System.Collections.Generic;
Using System. Linq;
Using System. The Text;
Using Autodesk. AutoCAD. ApplicationServices;
Using Autodesk. AutoCAD. DatabaseServices;
Using Autodesk. AutoCAD. EditorInput;
Using Autodesk. AutoCAD. Geometry;
Using Autodesk. AutoCAD. The Runtime;
Using DotNetARX;
The namespace NTTC
{
Public class GetHorizontal
{
[CommandMethod (" Horizontal ")]
Public static void Horizontal ()
{
Document doc=Application. The DocumentManager. MdiActiveDocument;
The Editor Ed=doc. Editor;
//create a custom list of TypedValue object, used to build the filter list
TypedValueList values=new TypedValueList ();
Values. The Add (typeof (Line));
Values. The Add (DxfCode Operator, & gt;"=");
Values. The Add (DxfCode. Angle, 0).
//build the filter list, note here use the custom type conversion
SelectionFilter filter=new SelectionFilter (values);
//select all meet the requirements of the filter in the graphics object, namely show 0 degrees and x is the direction of object
PromptSelectionResult PSR=Ed SelectAll (filter);
If (PSR) Status==PromptStatus) OK)
{
Application. ShowAlertDialog (" select the number of lines: "+ PSR. Value. Count. The ToString ());
}
}
}
}
]
Why the code above doesn't work,
I think the problem should be out in DXFCode. Angle, and how to use this want excuse me
CodePudding user response:
The wrong values. The Add (DxfCode Operator, & gt; ""="); Changing values. The Add (DxfCode Operator, "="); But still doesn't workCodePudding user response:
For help, and a great god for help