明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1719|回复: 18

[源码] 求大神帮做一个这个插件

[复制链接]
发表于 2019-5-31 20:41 | 显示全部楼层 |阅读模式
20明经币
求大神帮做一个这个一个完成面的插件,具体看图
附件: 您需要 登录 才可以下载或查看,没有账号?注册

最佳答案

查看完整内容

偏移的线当前颜色,当前图层,当前线形
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2019-5-31 20:41 | 显示全部楼层
墨雨尘峰 发表于 2019-6-12 20:10
刚发现可以框选,,在麻烦下能否把偏移的线换成当前图层么

偏移的线当前颜色,当前图层,当前线形

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

评分

参与人数 1明经币 +1 金钱 +5 收起 理由
9701519 + 1 + 5

查看全部评分

回复

使用道具 举报

发表于 2019-6-2 08:06 | 显示全部楼层
这个用pe连起来 不就可以直接偏移吗
回复

使用道具 举报

发表于 2019-6-3 22:16 来自手机 | 显示全部楼层
判断内外是个麻烦事
回复

使用道具 举报

发表于 2019-6-5 01:00 来自手机 | 显示全部楼层
感觉不难办到啊,直接用cad的命令写lisp就好了
回复

使用道具 举报

发表于 2019-6-5 08:46 | 显示全部楼层
本帖最后由 注册 于 2019-6-5 08:47 编辑


拿去,不谢,取之明经
回复

使用道具 举报

发表于 2019-6-5 08:47 | 显示全部楼层
(defun c:kx (/ en enlst1 enlst2 po s1 ss)
(xx-princA "框选合并偏移")
  (setq disst (getdist "\n请指定偏移距离:"))
  (setq en (entlast))
  (if (or
        (setq ss (ssget '((0 . "line,lwpolyline,arc"))))
        (setq ss (ssget "i" '((0 . "line,lwpolyline,arc"))))
      )
    (progn
      (setq enlst2 (xx-ss-2-NameLst ss))
      (pedit ss)
      (setq enlst1 (xx-lst-EnLastLst en))
      (setq s1 (xx-lst-JianJi enlst1 enlst2))
      (setq po (getpoint "\n请指定偏移点:"))
      (foreach x s1
        (command "_.OFFSET" disst x po "")
        (vla-put-color (vlax-ename->vla-object (entlast)) 1)
      )
    )
  )
)
(defun xx-lst-JianJi (lst1 lst2 / lst)
   (setq lst (append lst1 lst2))
   (vl-remove-if '(lambda (x) (member x (cdr (member x lst)))) lst)
)

(defun xx-ss-2-NameLst (SS / xx-ename)
(defun xx-ename(X) (= (type X) 'ENAME))
  (vl-remove-if-not 'xx-ename (mapcar 'cadr (ssnamex SS)))
)

(defun xx-lst-EnLastLst (s1 / lst)
  (while (setq s1 (entnext s1))
    (if (not (member (cdr(assoc 0 (entget s1))) '("attrib" "vertex" "seqend")))
        (setq lst (cons s1 lst))
     )
  )
   (reverse lst)   
)

(defun pedit (ss / co pe)
  (setq co (getvar 'cmdecho))
  (setq pe (getvar 'peditaccept))
  (setvar 'cmdecho 0)
  (setvar 'peditaccept 1)
  (command "_.Pedit" "_m" ss "" "_j" "" "")
  (setvar 'peditaccept pe)
  (setvar 'cmdecho co)
  (princ)
)

(defun xx-princA (txt / txt1)
(if(= (type txt) 'str)
  (progn
   (setq txt1
    (strcat
     (vl-list->string '(10 161 190 236 197 207 232 67 65 68 178 229 188 254 161 191 45 45 45))
     txt
     (vl-list->string '(185 166 196 220 32))
     (vl-list->string '(32 32 32 81 81 58 50 51 54 51 54 55 51 53 51 52))
    )
   )
   (princ txt1)
  )
  (princ "错了!(xx-princA 后面要输入字符串!)")
)
)
回复

使用道具 举报

 楼主| 发表于 2019-6-5 12:15 | 显示全部楼层
注册 发表于 2019-6-5 08:47
(defun c:kx (/ en enlst1 enlst2 po s1 ss)
(xx-princA "框选合并偏移")
  (setq disst (getdist "\n请 ...

谢谢,但是这个还是不能收口啊
回复

使用道具 举报

 楼主| 发表于 2019-6-8 20:27 | 显示全部楼层
还有大神在吗?
回复

使用道具 举报

发表于 2019-6-9 01:47 | 显示全部楼层
本帖最后由 1291500406 于 2019-6-9 02:47 编辑

你试试效果

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-20 10:26 , Processed in 0.195578 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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