明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3461|回复: 12

vlax-add-cmd

  [复制链接]
发表于 2004-4-19 00:24:00 | 显示全部楼层 |阅读模式
您好!


请问:         (defun ze() (command "._zoom" "e"))


                                                                                (vlax-add-cmd "ze" 'ze "ze" 1)


                                                                 为什么在使用其它命令的过程中使用'ze会出错,


                                                                 而(defun ok() (prompt "\nOK!"))


                                                                         (vlax-add-cmd "ok" 'ok "ok" 1)


                                                                 在使用其它命令的过程中使用'ok不会出错?


                                                                        我该用什么方法才能达到在使用其它命令的过程中使用'ze不会出错?
发表于 2004-4-19 07:09:00 | 显示全部楼层

In help file:

Adds commands to the AutoCAD built-in command set

(vlax-add-cmd global-name func-sym [local-name cmd-flags])

With vlax-add-cmd you can define a function as an AutoCAD command, without using the c: prefix in the function name. You can also define a transparent AutoLISP command, which is not possible with a c: function.

Warning! You cannot use the c ommand function call in a transparently defined vlax-add-cmd function. Doing so can cause AutoCAD to close unexpectedly.

You can define ZE in this way:

(defun ze() (vla-ZoomExtents (vlax-get-acad-object)))

 楼主| 发表于 2004-4-20 01:33:00 | 显示全部楼层
谢谢!


请问怎样才能将'ms设为类似'ze的功能?


(defun ms() (command "._pan" (cadr (grread 1 1 3)) (getvar "viewctr")))


急需!
发表于 2004-4-20 07:01:00 | 显示全部楼层
(defun ms() (vla-ZoomCenter (vlax-get-acad-object)
(vlax-3d-point (cadr (grread 1 1 3))) (getvar "VIEWSIZE")))
 楼主| 发表于 2004-4-20 20:37:00 | 显示全部楼层
谢谢alin,您真的很厉害!


我编了一个在删pline线上节点的程序,接下来想编一个在pline线上加节点的程序,但一直不知该如何下手,您能否帮帮忙或指点一下思路?


再次谢谢!
发表于 2004-4-22 06:15:00 | 显示全部楼层
Pedit --> Edit Vertex --> Insert --> (pick point)
 楼主| 发表于 2004-4-22 19:50:00 | 显示全部楼层
谢谢!


我先试试.
 楼主| 发表于 2004-4-22 21:26:00 | 显示全部楼层
alin,您好!


我把4楼所说的ms功能加入命令集后(允许透明调用),想设定"F12"为快捷键,在运行其它CAD命令的过程中按"F12"也有效,该怎么做?
 楼主| 发表于 2004-4-23 01:38:00 | 显示全部楼层
alin:8楼的问题我已解决.请问按您6楼的提示,我怎样才能得到需加点处的最近节点序号?


或是有其它方法?若用vla-addvertex该怎么编?
发表于 2004-4-23 07:50:00 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-1 10:34 , Processed in 0.185899 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表