乐筑天下

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

[编程交流] vlax-add/remove-cmd

[复制链接]

41

主题

301

帖子

265

银币

后起之秀

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

铜币
209
发表于 2022-7-6 12:05:26 | 显示全部楼层 |阅读模式
hey guys
 
Im having a bit of truble with those two commands.
 
Simply im finding that if i load it into one drawing1, then load in into drawing2, drawing 1 will lose its command and return
 
The reason im using it is because when it come to re-defineing commands i thought this would be easyer
Here is an example where its inbeded in a Foreach function of each function
and where NewKeyList is a list of what the are to be defined as
  1. (vlax-remove-cmd (cadr nm))   (if NewKeyList     (progn           (setenv (car nm) (nth Int_Count NewKeyList))     (setq Int_Count (1+ Int_Count))))   (eval (read (strcat "(vlax-add-cmd ""(getenv (car nm)) "" '" (caddr nm)")")))
 
thanks for any input
 
flower
回复

使用道具 举报

1

主题

316

帖子

311

银币

初来乍到

Rank: 1

铜币
29
发表于 2022-7-6 12:13:05 | 显示全部楼层
 
 
Could you not use for example:
 
  1. (if (not c:fillet) (command "._UNDEFINE" "_FILLET"))
 
then put same command name for your lisp routine.
回复

使用道具 举报

41

主题

301

帖子

265

银币

后起之秀

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

铜币
209
发表于 2022-7-6 12:21:01 | 显示全部楼层
Sorry when i said redefining commands i am refering to routines
 
thus
 
  1. (defun c:hi () (princ "hi") (princ))(command "._UNDEFINE" "hi"))
returns
 
  1. Unknown command name.
SystemProtection-V.1.Lsp
回复

使用道具 举报

1

主题

316

帖子

311

银币

初来乍到

Rank: 1

铜币
29
发表于 2022-7-6 12:29:18 | 显示全部楼层
seems like a namespace issue if you're going that way.  You might like to try (Setq c:hi nil) or do a vl-load-all call
回复

使用道具 举报

41

主题

301

帖子

265

银币

后起之秀

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

铜币
209
发表于 2022-7-6 12:32:16 | 显示全部楼层
when i press hi returns
 
Could you explan this vl-load-all call
since every thing is in a .vlx
 
Aswell i would like it to transfer threw open doc's if possible
 
Cheers Flower
回复

使用道具 举报

0

主题

14

帖子

14

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 12:42:42 | 显示全部楼层
Have you tried using vl-acad-undefun?
 
This works for me:
  1. (foreach x '(c:routine1 c:routine2 c:routineN) (vl-acad-undefun x))
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 12:51:22 | 显示全部楼层
Welcome to CADTutor Steve - nice to see you here
回复

使用道具 举报

0

主题

14

帖子

14

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 12:55:32 | 显示全部楼层
Thanks Lee! : )
回复

使用道具 举报

41

主题

301

帖子

265

银币

后起之秀

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

铜币
209
发表于 2022-7-6 12:59:38 | 显示全部楼层
Cheers mate works great didnt think to lookin in VL for undefun
回复

使用道具 举报

0

主题

14

帖子

14

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 13:09:02 | 显示全部楼层
Glad to help!
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 10:30 , Processed in 0.912894 second(s), 72 queries .

© 2020-2025 乐筑天下

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