明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 515|回复: 6

[提问] 关于画双线每个线指定图层问题

[复制链接]
发表于 2019-11-24 14:07 | 显示全部楼层 |阅读模式
5明经币
本帖最后由 403181713 于 2019-11-24 19:21 编辑

前两天借用了论坛上的一段代码画双线,忘了哪位朋友写的了,现在我想画过双线后,每一根线可以指定图层。恳请高手指点!代码如下:

[br](defun c:2L()
(if (= wwdy nil) (setq wwdy 4))
(setq str1 (rtos wwdy 2 2))
(prompt "\n  now dline width is: ")
(prompt str1)
(setq pt1 (getpoint "\n enter start point:"))
(setq pt2 (getpoint pt1 "\n enter next point:"))
(setq dis1 (* 0.5 wwdy))
(setq ag1 (angle pt1 pt2))
(setq pt1u (polar pt1 (+ ag1 1.5708) dis1))
(setq pt2u (polar pt2 (+ ag1 1.5708) dis1))
(setq pt1d (polar pt1 (- ag1 1.5708) dis1))
(setq pt2d (polar pt2 (- ag1 1.5708) dis1))
(command "pline" "non" pt1u "non" pt2u "")
(command "pline" "non" pt1d "non" pt2d "")
(repeat 100
   (setq pt1 pt2)
   (setq pt2 (getpoint pt1 "\n enter next point:"))
   (setq dis1 (* 0.5 wwdy))
   (setq ag1 (angle pt1 pt2))
   (setq pt1u (polar pt1 (+ ag1 1.5708) dis1))
   (setq pt2u (polar pt2 (+ ag1 1.5708) dis1))
   (setq pt1d (polar pt1 (- ag1 1.5708) dis1))
   (setq pt2d (polar pt2 (- ag1 1.5708) dis1))
   (command "pline" "non" pt1u "non" pt2u "")
   (command "pline" "non" pt1d "non" pt2d "")
)
)





初入LISP小白,熬了一星期夜解决不了!有劳大佬了,跪谢!

发表于 2019-11-24 14:07 | 显示全部楼层
此帖仅作者可见

使用道具 举报

发表于 2019-11-24 15:21 | 显示全部楼层
此帖仅作者可见

使用道具 举报

发表于 2019-11-24 15:39 | 显示全部楼层
此帖仅作者可见

使用道具 举报

发表于 2019-11-24 15:57 | 显示全部楼层
此帖仅作者可见

使用道具 举报

 楼主| 发表于 2019-11-24 18:44 | 显示全部楼层
此帖仅作者可见

使用道具 举报

 楼主| 发表于 2019-12-9 19:06 | 显示全部楼层
此帖仅作者可见

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-17 13:06 , Processed in 0.170644 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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