乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 24|回复: 0

[编程交流] 分享!match_图案填充

[复制链接]

26

主题

145

帖子

122

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
130
发表于 2022-7-5 22:15:40 | 显示全部楼层 |阅读模式
  1. (defun c:match_hatch (/ s0 hp ha hs ss i s1)
  2. (if (and
  3. (setq s0 (car (entsel "\nSelect source hatch: ")))
  4. (TKS-etype s0 "hatch")
  5.      )
  6.    (progn
  7.      (redraw s0 3)
  8.      (setq hp (TKS-get-dxf 2 s0)
  9.     ha (TKS-r2d (TKS-get-dxf 52 s0))
  10.     hs (TKS-get-dxf 41 s0)
  11.      )
  12.      (setvar "CLAYER" (TKS-get-dxf 8 s0))
  13.      (princ "\nSelect destination object: ")
  14.      (if (setq ss (ssget '((0 . "*polyline,circle,ellipse")))
  15.         i -1
  16.   )
  17. (progn
  18.   (while (setq s1 (ssname ss (setq i (1+ i))))
  19.     (command "hatch" hp hs ha s1 "")
  20.   )
  21. )
  22.      )
  23.      (redraw s0 4)
  24.    )
  25. )
  26. )
  27. (defun TKS-R2D (rad)
  28. (* (/ rad pi) 180.0)
  29. )
  30. (defun TKS-Etype (ename etype)
  31. (wcmatch (TKS-get-dxf 0 ename) (strcase etype))
  32. )
  33. (defun TKS-get-DXF (code ename / ent lst a)
  34. (if (= (type code) 'LIST)
  35.    (progn
  36.      (setq ent (entget ename)
  37.     lst '()
  38.      )
  39.      (foreach a code
  40. (setq lst (cons (list a (cdr (assoc a ent))) lst))
  41.      )
  42.      (reverse lst)
  43.    )
  44.    (if (= code -3)
  45.      (cdr (assoc code (entget ename '("*"))))
  46.      (cdr (assoc code (entget ename)))
  47.    )
  48. )
  49. )

 
 
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-11 06:15 , Processed in 0.502980 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表