乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 29|回复: 1

请教为何无法选择?

[复制链接]

32

主题

140

帖子

5

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
268
发表于 2014-9-28 11:27:00 | 显示全部楼层 |阅读模式
using Autodesk..Runtime;
using Autodesk.AutoCAD.EditorInput;
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Geometry;
using Application = Autodesk.AutoCAD.ApplicationServices.Application;
using Document = Autodesk.AutoCAD.ApplicationServices.Document;
using System.Linq;
using System.Diagnostics;
namespace ClassLibrary5
{
    public class Class1
    {
        [CommandMethod("SEL")]
        public void sel()
        {
            Autodesk.AutoCAD.EditorInput.Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            SelectionFilter acSelFtr = new SelectionFilter(new TypedValue[] {
                     new TypedValue((int)DxfCode.Operator, "or")
                    });
            PromptSelectionResult res2 = ed.GetSelection(acSelFtr);
            if (res2.Status != PromptStatus.OK)
            {
                return;
            }
            else
            {
                ed.SetImpliedSelection(res2.Value.GetObjectIds());
            }
        }
    }
}
加载后,运行SEL,命令不执行,如果我把过滤条件改成单个,可以正常选择,请教老大们是哪里出了问题?
            SelectionFilter acSelFtr = new SelectionFilter(new TypedValue[] {
                        new TypedValue((int)DxfCode.Start, "DIMENSION")
                    });
回复

使用道具 举报

32

主题

140

帖子

5

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
268
发表于 2014-9-28 11:42:00 | 显示全部楼层
哎原来是这句写错了new TypedValue((int)DxfCode.Operator, ">or"); 应该是"or>"!我这个大晕蛋
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-13 21:25 , Processed in 1.454574 second(s), 67 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表