andrew361 发表于 2022-7-6 14:21:22

试着让这个口齿不清

我创建这个lisp文件是为了插入ground、hot、nuetral块和其他块,但似乎无法正常工作,任何建议都会有所帮助
谢谢
 
代码:
(默认c:hr测试()
(命令“-layer“s”ee wire”)
(命令行“pause pause”)
(命令“insert”“z:/details/nrg/elec/blocks/arrowh”pause“1”“1”pause)
(SETQ NUM(-getint“\n\n每个电路的HOT数”)1)
 
(如果1(=数字1)(命令“insert”“z:/details/nrg/elec/blocks/u elec\u ghn”pause“1”“1”pause))
(如果2(=数字2)(命令“insert”“z:/details/nrg/elec/blocks/\u elec\u ghhn”pause“1”“1”pause))
(命令“-layer“s”“ee text”“”)
(命令“多行文字”暂停)
出来
(收尾)
)

The Buzzard 发表于 2022-7-6 14:27:55

 
首先,您试图设置一个层,因此层需要在那里才能通过该部分。尝试制作图层。
该程序也在搜索块。你没有上传他们,所以我不能从那里测试,因为程序在那一点上停止。
请提供程序所需的模块,以便对其进行测试。
 
谢谢
秃鹰

The Buzzard 发表于 2022-7-6 14:29:30

另外,请详细说明您遇到的具体问题,以便我们知道需要寻找什么。这也将是一个很大的帮助。

andrew361 发表于 2022-7-6 14:34:40

我确实有我的图层设置和整个例程运行,但当is询问每个电路有多少个HOT时,你点击1或2,这是唯一加载的两个块,它不会将块带入,而是直接进入mtext
_电气GHN。图纸
_ELEC_GHHN。图纸

The Buzzard 发表于 2022-7-6 14:40:08

 
 
 
您丢失的一个名为(箭头)。你能附上它吗?

The Buzzard 发表于 2022-7-6 14:40:58

 
 
(defun c:HRtest ()
(command "-layer" "m" "ee-wire" "")
(command "LINE" pause pause "")
(command "insert" "z://details//nrg//elec//blocks//arrowh" pause "1" "1" pause)
(SETQ NUM (- (getint "\n\Number of hots per Circuit ") 1))
(if 1 (= num 1) (command "insert" "z://details//nrg//elec//blocks//_elec_ghn" pause "1" "1" pause) )
(if 2 (= num 2) (command "insert" "z://details//nrg//elec//blocks//_elec_ghhn" pause "1" "1" pause) )
(command "-layer" "s" "ee-text" "")
(command "mtext" pause )
out
(close out)
)

 
我认为您需要在路径上使用双斜线(//)
试试看。

andrew361 发表于 2022-7-6 14:47:21

附件是箭头方块,对不起
箭头H。图纸

ronjonp 发表于 2022-7-6 14:48:21

你能贴一张有最终结果的图吗?这听起来很像一个动态块可以做到这一点。

The Buzzard 发表于 2022-7-6 14:54:08

同时删除提示中的此斜杠。
 
 

(defun c:HRtest
(command "-layer" "m" "ee-wire" "")
(command "LINE" pause pause "")
(command "insert" "z://details//nrg//elec//blocks//arrowh" pause "1" "1" pause)
(SETQ NUM (- (getint "\n\Number of hots per Circuit ") 1))
(if 1 (= num 1) (command "insert" "z://details//nrg//elec//blocks//_elec_ghn" pause "1" "1" pause) )
(if 2 (= num 2) (command "insert" "z://details//nrg//elec//blocks//_elec_ghhn" pause "1" "1" pause) )
(command "-layer" "s" "ee-text" "")
(command "mtext" pause )
out
(close out)
)

The Buzzard 发表于 2022-7-6 14:58:35

我修改了代码,因为我不打算创建所有这些目录。在(if 1(=NUM 1)(if 2(=NUM 2))之后还有一个1和2,我删除了它们,它起了作用。
 
(defun c:HRtest ()
(command "-layer" "m" "ee-wire" "")
(command "LINE" pause pause "")
(command "insert" "arrowh" pause "1" "1" pause)
(SETQ NUM (- (getint "\nNumber of hots per Circuit ") 1))
(if (= NUM 1) (command "insert" "_elec_ghn" pause "1" "1" pause) )
(if (= NUM 2) (command "insert" "_elec_ghhn" pause "1" "1" pause) )
(command "-layer" "m" "ee-text" "")
(command "mtext" pause )
out
(close out)
)
页: [1] 2
查看完整版本: 试着让这个Lisp程序