sigster 发表于 2022-3-23 06:48:03

过滤器类型值模型空间

Hi
如何进行过滤,以便只从模型空间中进行选择
如果我像这样使用它,该命令只需结束
Dim filter for As typed value()= { New typed value(0," LINE,ARC,CIRCLE,SPLINE,LWPOLYLINE,ELLIPSE,INSERT,MTEXT,TEXT,POINT "),New TypedValue(410," Model))}

         Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            If doc Is Nothing Then Return
            Dim ed As Editor = doc.Editor
            'Dim filterfor As TypedValue() = {New TypedValue(0, "LINE,ARC,CIRCLE,SPLINE,LWPOLYLINE,ELLIPSE,INSERT,MTEXT,TEXT,POINT"), New TypedValue(410, "Model")}
            Dim filterfor As TypedValue() = {New TypedValue(0, "LINE,ARC,CIRCLE,SPLINE,LWPOLYLINE,ELLIPSE,INSERT,MTEXT,TEXT,POINT")}
            Dim sf As SelectionFilter = New SelectionFilter(filterfor)
            Dim rsSel As PromptSelectionResult = ed.SelectAll(sf)
            If rsSel.StatusPromptStatus.OK OrElse rsSel.Value.Count = 0 Then Return
            Dim rsEnt As PromptEntityResult = ed.GetEntity("Select Polyline")
            If rsEnt.StatusPromptStatus.OK Then Return

**** Hidden Message *****

Jeff_M 发表于 2022-3-23 10:26:05


“线,点”是一个问题,如果我只使用线,但如果我添加更多的类型,如“线,点”,命令结束

sigster 发表于 2022-3-23 11:08:50


像这样的工作解决了

      Dim acTypValAr(1) As TypedValue
            acTypValAr.SetValue(New TypedValue(DxfCode.Start, "INSERT,LINE,LWPOLYLINE,MTEXT,TEXT,POINT"), 0)
            acTypValAr.SetValue(New TypedValue(DxfCode.LayerName, "LAYERNAME"), 1)
页: [1]
查看完整版本: 过滤器类型值模型空间