lzj511 发表于 2009-8-29 17:56:00

[求助]opendcl里面为何不能用command 命令?

<p>刚开始学习opendcl,opendcl里面不能用cammand 命令,这个问题怎么解决啊?</p>

5061220 发表于 2009-8-29 18:13:00

<p>能用,我用了几个没有问题</p>

5061220 发表于 2009-8-29 18:17:00

<p>工具Sample文件夹中的Modeless非模式对话调用的Command,实例</p><p><br/>(DEFUN c:Modeless ( /&nbsp; )<br/>&nbsp; (or LoadRunTime (load "_OpenDclUtils.lsp") (exit))<br/>&nbsp; (LoadRunTime)<br/>&nbsp; (LoadODCLProj "Modeless.odcl")<br/>&nbsp; (dcl_FORM_SHOW Modeless_DemoModeless)<br/>&nbsp; (PRINC)<br/>)</p><p></p><p><br/>(defun c:DemoModeless_cmdDrawLine_OnClicked ()<br/>&nbsp; (command "._LINE" "0,0" "10,10" "")<br/>)</p><p>(defun c:DemoModeless_cmdZoomWin_OnClicked ()<br/>&nbsp; (command "._ZOOM" "_W" PAUSE PAUSE)<br/>)</p><p>(defun c:DemoModeless_cmdZoomExt_OnClicked ()<br/>&nbsp; (command "._ZOOM" "_E" )<br/>)</p><p><br/>(defun c:DemoModeless_CloseButton_Clicked ()<br/>&nbsp;&nbsp; (dcl_Form_Close Modeless_DemoModeless)&nbsp;&nbsp; <br/>)</p><p>(princ)</p><p><br/></p>

lzj511 发表于 2009-8-29 18:38:00

<p>命令前面为什么加“._"啊?我的出现invalid AutoCAD command: nil错误</p>

5061220 发表于 2009-8-29 19:46:00

<p>这个我也搞不清,但不加“._"也能用。</p>

5061220 发表于 2009-8-29 19:52:00

<p>下面是我改写的等比缩放lsp源程序,红色部分是调用系统命令的。</p><p>OpenDCL制作的对话框的lsp支持文件中“command”调用系统命令或自定义命令没有作任何改动。</p><p>&nbsp; ;*******************************************************等比例缩放<br/>(DEFUN c:sd (/<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c:Msd_demoMsd_oksd_OnClicked<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c:Msd_demoMsd_closesd_OnClicked<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; (defun c:Msd_demoMsd_oksd_OnClicked&nbsp;(/ s p)<br/>&nbsp;(setvar "cmdecho" 0)<br/>&nbsp;(dcl_Form_Close Msd_demoMsd)<br/>&nbsp;(Setq s (dcl_Control_GetText Msd_demoMsd_Tbsd1))<br/>&nbsp;(while (setq p (ssget))<br/>&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff0000"><strong>(command "scale" p "" (getpoint "\n--选取缩放基准点:") s)<br/></strong></font>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;(princ)&nbsp;)<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; (defun c:Msd_demoMsd_closesd_OnClicked (/)<br/>&nbsp;(dcl_Form_Close Msd_demoMsd))</p><p><br/>&nbsp;&nbsp;&nbsp; (or LoadRunTime (load "_OpenDclUtils.lsp") (exit))<br/>&nbsp;&nbsp;&nbsp; (LoadRunTime)<br/>&nbsp;&nbsp;&nbsp; (LoadODCLProj "C:/Program Files/Chaiyu/T_Modify/Msd.odcl")<br/>&nbsp;&nbsp;&nbsp; (dcl_FORM_SHOW Msd_DemoMsd)<br/>&nbsp;&nbsp;&nbsp; (PRINC)<br/>&nbsp;&nbsp;&nbsp; )</p>

cjs 发表于 2009-9-28 17:35:00

<p>将Event Invoke属性设置为1--Asynchronous</p><p></p>

zark 发表于 2010-1-6 20:11:00

<p>在使用前加“.”或“_”或“._”可能避免原来命令被undefin后还能用。你如果把“line”给undefin了后,用COMMAND调用他,他会提示“未知命令”,如果你在“LINE”前加“.”或“_”或“._”就不会了。</p>

libo2000 发表于 2010-4-9 22:39:00

本帖最后由 作者 于 2010-4-12 0:29:07 编辑

function XML() {
   
}

nuist 发表于 2010-9-8 09:15:00

cjs发表于2009-9-28 17:35:00static/image/common/back.gif将Event Invoke属性设置为1--Asynchronous


<p>在非模态对话框里有事件调用的控件,都得将Event Invoke属性设置为1--Asynchronous,才能用command命令</p>
页: [1] 2
查看完整版本: [求助]opendcl里面为何不能用command 命令?