明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 371|回复: 1

[提问] 大神们啊,救救我吧(已解决,代码没错,推测软件没装好)

[复制链接]
发表于 2021-12-1 16:59:55 | 显示全部楼层 |阅读模式
本帖最后由 fedd 于 2021-12-2 06:05 编辑

请前辈指点,为什么折断线指定图层就不行呢?如果把2细线层这一句代码删除就没问题,加上就不行,明明这个图层是有的,为什么不行呢?
(defun c:77 (/ pt1 pt2 pt3 pt4 pt5 pt6 ang dis old1)
(setq old1 (getvar "blipmode"))
(setvar "blipmode" 0)
(setvar "clayer" "2细线层")
(setvar "OSMODE" 16383)
(setq pt1 (getpoint "\nSelect the first point:"))
(setq pt2 (getpoint pt1 "\nSelect the second point:"))

(setq dis (distance pt1 pt2))
(setq ang (angle pt1 pt2))
(setq pt1 (polar pt1 (+ pi ang) (* dis 0.15)))
(setq pt2 (polar pt2 ang (* dis 0.15)))
(setq pt3 (polar pt1 ang (* dis 0.6)))
(setq pt4 (polar pt3 (- ang (* (/ 80.0 180.0) pi)) (* dis 0.15)))
(setq pt5 (polar pt4 (+ ang (* (/ 80.0 180.0) pi)) (* dis 0.3)))
(setq pt6 (polar pt5 (- ang (* (/ 80.0 180.0) pi)) (* dis 0.15)))
(setvar "osmode" 0)
(command "_Pline" pt1 "W" 0 0 pt3 pt4 pt5 pt6 pt2 "")
(setvar "osmode" 255)
(setvar "blipmode" old1)
)        ;;end defun

发表于 2021-12-1 17:05:08 | 显示全部楼层
同一个问题不要重复发帖
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-15 07:09 , Processed in 0.173115 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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