Search code examples
c#autocadautocad-plugin

AutoCAD .NET Selection set filter: What types of entities can be add to the filter to be selected?


  1. I am using selection set filter to select certain types of entities in a drawing. It happened to me that I can add Line, Circle, Ellipse... to my filter for the types of entities to be selected. However, I can not add Polyline to the filter. Why is that? What is the types of entities I can add to a selection set filter and what types I can not?

  2. The DfxCode.Start only specify the object to instantiate a TypedValue is a string. How will AutoCAD .net recognize the string to decide which type of entities to add to the selection set? Is there a pre-defined series of string value for this conversion/ recognition?

P/s: the .net dev guide only shows that I can add entity to selection set, not much else. Any explanation or suggestion is much appreciated.


Solution

  • You can use the DXF Entities in a SelectionFilter listed at http://help.autodesk.com/view/ACD/2018/ENU/?guid=GUID-7D07C886-FD1D-4A0C-A7AB-B4D21F18E484 To find that link, or similar, web-search for "dxf entities 2018" or whatever year-version of AutoCAD you are looking for.

    This is a pretty good example of how to set a filter: http://through-the-interface.typepad.com/through_the_interface/2008/07/conditional-sel.html. Search for "Autocad c# selection set filter" for similar.

    Polylines: there are POLYLINE & LWPOLYLINE in dxf. In AutoCAD there are 2d & 3d Polylines as well as lightweight ones.

    See the AutoCAD Tag wiki for more dev resources