李青松 发表于 2020-6-28 14:56:42

组合命令f 在autocad2012中运行不了,2004,2005.2006中可以运行。

本帖最后由 李青松 于 2020-6-28 15:15 编辑

(defun C:F ()
(if (ssget "i")
(c:tcrb)
(c:ff2)
))
(defun c:tcrb() (command "change" (ssget) "" "p"   "la" "软包" "c" "bylayer" "lt" "bylayer" ""))
(defun c:ff2 () (command"OSMODE" "4159" "ortho" "on" "line" ))

fan_zh 发表于 2020-6-28 15:44:09

请看高手的解答
http://bbs.mjtd.com/thread-80809-1-1.html

总之,调用command ,易受cad环境影响导致出错

htlaser 发表于 2020-6-28 16:37:05

(defun C:ttt (/ ss)
(if(= (tblsearch "layer" "软包") nil)(command "-layer" "n" "软包" "s" "软包" "")(command "-layer" "s" "软包" ""))
(setq ss (ssget "i"))
(if (= ss nil)
(c:tcrb)
(c:ff2)
))
(defun c:tcrb() (command "change" (ssget) "" "p"   "la" "软包" "c" "bylayer" "lt" "bylayer" ""))
(defun c:ff2 () (command"OSMODE" "4159" "ortho" "on" "line" ))

xvjiex 发表于 2020-6-28 16:51:39

本帖最后由 xvjiex 于 2020-6-28 16:55 编辑

提示错误信息是什么?
试一下这个看看


李青松 发表于 2020-6-29 11:07:11

xvjiex 发表于 2020-6-28 16:51
提示错误信息是什么?
试一下这个看看

你给的程序运行不了

李青松 发表于 2020-6-29 11:08:39

xvjiex 发表于 2020-6-28 16:51
提示错误信息是什么?
试一下这个看看

提示错误信息是 命令: f
change 找到 1 个
指定修改点或 [特性(P)]:
选择对象:

李青松 发表于 2020-6-29 11:09:12

htlaser 发表于 2020-6-28 16:37


2012中运行不了

htlaser 发表于 2020-6-29 11:21:02

李青松 发表于 2020-6-29 11:09
2012中运行不了

我测试没有问题啊

李青松 发表于 2020-6-29 11:51:02

htlaser 发表于 2020-6-29 11:21
我测试没有问题啊

可以用。当前层不要变,还要是0层。帮我改一下

李青松 发表于 2020-6-29 11:57:15

htlaser 发表于 2020-6-29 11:21
我测试没有问题啊

我觉得是以下的这个程序要重新写,写成先选对象再运行程序。
(defun c:tcrb() (command "change" (ssget) "" "p"   "la" "软包" "c" "bylayer" "lt" "bylayer" ""))
页: [1] 2
查看完整版本: 组合命令f 在autocad2012中运行不了,2004,2005.2006中可以运行。