[求助]opendcl里面为何不能用command 命令?
<p>刚开始学习opendcl,opendcl里面不能用cammand 命令,这个问题怎么解决啊?</p> <p>能用,我用了几个没有问题</p> <p>工具Sample文件夹中的Modeless非模式对话调用的Command,实例</p><p><br/>(DEFUN c:Modeless ( / )<br/> (or LoadRunTime (load "_OpenDclUtils.lsp") (exit))<br/> (LoadRunTime)<br/> (LoadODCLProj "Modeless.odcl")<br/> (dcl_FORM_SHOW Modeless_DemoModeless)<br/> (PRINC)<br/>)</p><p></p><p><br/>(defun c:DemoModeless_cmdDrawLine_OnClicked ()<br/> (command "._LINE" "0,0" "10,10" "")<br/>)</p><p>(defun c:DemoModeless_cmdZoomWin_OnClicked ()<br/> (command "._ZOOM" "_W" PAUSE PAUSE)<br/>)</p><p>(defun c:DemoModeless_cmdZoomExt_OnClicked ()<br/> (command "._ZOOM" "_E" )<br/>)</p><p><br/>(defun c:DemoModeless_CloseButton_Clicked ()<br/> (dcl_Form_Close Modeless_DemoModeless) <br/>)</p><p>(princ)</p><p><br/></p> <p>命令前面为什么加“._"啊?我的出现invalid AutoCAD command: nil错误</p> <p>这个我也搞不清,但不加“._"也能用。</p> <p>下面是我改写的等比缩放lsp源程序,红色部分是调用系统命令的。</p><p>OpenDCL制作的对话框的lsp支持文件中“command”调用系统命令或自定义命令没有作任何改动。</p><p> ;*******************************************************等比例缩放<br/>(DEFUN c:sd (/<br/> c:Msd_demoMsd_oksd_OnClicked<br/> c:Msd_demoMsd_closesd_OnClicked<br/> )</p><p> (defun c:Msd_demoMsd_oksd_OnClicked (/ s p)<br/> (setvar "cmdecho" 0)<br/> (dcl_Form_Close Msd_demoMsd)<br/> (Setq s (dcl_Control_GetText Msd_demoMsd_Tbsd1))<br/> (while (setq p (ssget))<br/> <font color="#ff0000"><strong>(command "scale" p "" (getpoint "\n--选取缩放基准点:") s)<br/></strong></font> )<br/> (princ) )<br/> <br/> (defun c:Msd_demoMsd_closesd_OnClicked (/)<br/> (dcl_Form_Close Msd_demoMsd))</p><p><br/> (or LoadRunTime (load "_OpenDclUtils.lsp") (exit))<br/> (LoadRunTime)<br/> (LoadODCLProj "C:/Program Files/Chaiyu/T_Modify/Msd.odcl")<br/> (dcl_FORM_SHOW Msd_DemoMsd)<br/> (PRINC)<br/> )</p> <p>将Event Invoke属性设置为1--Asynchronous</p><p></p> <p>在使用前加“.”或“_”或“._”可能避免原来命令被undefin后还能用。你如果把“line”给undefin了后,用COMMAND调用他,他会提示“未知命令”,如果你在“LINE”前加“.”或“_”或“._”就不会了。</p> 本帖最后由 作者 于 2010-4-12 0:29:07 编辑function XML() {
} cjs发表于2009-9-28 17:35:00static/image/common/back.gif将Event Invoke属性设置为1--Asynchronous
<p>在非模态对话框里有事件调用的控件,都得将Event Invoke属性设置为1--Asynchronous,才能用command命令</p>
页:
[1]
2