明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 785|回复: 6

[提问] 怎样知道ucs名已使用

[复制链接]
发表于 2016-5-3 11:08 | 显示全部楼层 |阅读模式
保存当前ucs时
(command "ucs" "s" "1234")
若“1234”已经被使用,需要增加一个“y”
(if ******
        (command "ucs" "s" "1234" “y”)
        (command "ucs" "s" "1234")
)
请问一下*****部分该怎么写


发表于 2016-5-3 12:55 | 显示全部楼层
本帖最后由 lxw320 于 2016-5-3 12:57 编辑

  1. (= (getvar "ucsname") "1234")

发表于 2016-5-3 12:58 | 显示全部楼层
看了这个,你可能明白http://bbs.xdcad.net/thread-678868-1-1.html
 楼主| 发表于 2016-5-3 14:49 | 显示全部楼层
lxw320 发表于 2016-5-3 12:55

这个没用吧,若目前的ucs不是“1234”,想存为“1234”就不管用
发表于 2016-5-4 09:22 | 显示全部楼层
方法1:(not (vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list (vla-get-usercoordinatesystems (vla-get-activedocument (vlax-get-acad-object))) "1234"))))
方法2不需要判断:(vl-cmdf "ucs" "save" "1234") (if (= (getvar "cmdactive") 1) (vl-cmdf "y"))
发表于 2016-5-4 11:52 | 显示全部楼层

  1. (tblsearch "ucs" "1234")
复制代码
发表于 2016-5-6 12:38 | 显示全部楼层
  1. (if (= (getvar "ucsname") "1234")                  
  2.     (command "ucs" "_d" "1234" "UCS" "_s" "1234")
  3.     (command "UCS" "_s" "1234")
  4. )

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

本版积分规则

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

GMT+8, 2024-4-25 22:08 , Processed in 0.315995 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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