Hi,
I'm thinking to work a filter machinum like AutoCAD's.
I have a system to link a lot data to a AutoCAD graphic object (LINE, ARC, PLINE). is it possible to create filter system e.g.
(-4 . "<OR")
(-4 . "<AND")("Dept" . "HR")("Salary" ">8000")(-4 . "AND>")
(-4 . "<AND")("Dept" . "IT")("Salary" ">12000")(-4 . "AND>")
...
(-4 . "OR>")
how to design the syntax and implement the engine?
If you can point me the right direction, I appreciate your time
Wes
Something like this?
' Select
Dim Sel As New PromptEntityOptions("Select:")
Sel.SetRejectMessage("You must select an arc or circle object." & vbCrLf)
Sel.AddAllowedClass(GetType(Arc), False)
Sel.AddAllowedClass(GetType(Circle), False)
Sel.AddAllowedClass(GetType(Polyline), False)
Dim myPER As PromptEntityResult = myEd.GetEntity(Sel)
Cheers,
Martin
Hi,
>> ("Dept" . "HR")("Salary" ">8000")
As there is no standard for saving "Dept" or "Salary" it would be great to know where you did store this values. There are so much options like EED's, XRecords, AttributeReferences, ObjectData (for Map3D) ... also part of layernames ....
Then we have a chance to give you input how you can filter to objects that matches these values.
- alfred -
Oh yeah I see, sorry, I thought you were just trying to select geometry. I should have read OP properly.
Not sure exactly what you are wanting to do.
Are you wanting to implement your own Filter mechinism inside AutoCAD or use AutoCADs filter mechinism to pullout information?
If you are trying to create your own and using a .NET language have you thought about using Linq instead?
http://drive-cad-with-code.blogspot.com/2011/04/tips-of-using-linq-in-autocad-net.html
Thank you, Mike.
I like to create my own filter, filte my own data. It could be store anywhere, external database, xdata and dictionary.
It work similiar to AutoCAD's, or like database
SELECT
FROM
WHERE (Dept = "HR" AND Salary>8000)
OR
(Dept = "IT" AND Salary>12000)
...
I need define a syntax and implement a engine to with it. I have no idea where to start.
Thank you again for your time.
Wes