www.mxdraw.com
内容索引主面
前一个向上下一个
_DMxDrawX::SendStringToExecuteEx 方法

执行一个命令,可以传参数.

IDL
[id(187), helpstring("method SendStringToExecuteEx")]
VARIANT_BOOL SendStringToExecuteEx(BSTR sCmdName, IDispatch* pParam);
参数 
说明 
pszExecute 
命令名 pParam -命令参数,MxDrawResbuf对象 

例如: 调用阵列命令,并传递参数.

                        MxDrawSelectionSet ss = new MxDrawSelectionSet();
                        MxDrawUtility utility = new MxDrawUtility();
                        utility.Prompt("选择阵列对象:");
                        ss.Select(MCAD_McSelect.mcSelectionSetUserSelect, null, null, null);
                        if (ss.Count == 0)
                            return;

                        MxDrawResbuf param = new MxDrawResbuf();

                        // 10行.
                        param.AddLongEx(10, 1070);

                        // 20列.
                        param.AddLongEx(20, 1070);

                        // 行偏移.
                        param.AddDoubleEx(100, 1040);

                        // 列偏移.
                        param.AddDoubleEx(150, 1040);

                        // 阵列角度.
                        param.AddDoubleEx(15.0, 1040);

                        // 阵列对象个数.
                        param.AddLongEx(ss.Count, 1070);
                        for (int i = 0; i < ss.Count; i++)
                        {
                            MxDrawEntity ent = ss.Item(i);
                            param.AddObjectId(ent.ObjectID);
                        }

                        // 调用阵列命令.
                        axMxDrawX1.SendStringToExecuteEx("Mx_Array", param);
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!