明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 325|回复: 5

【MakeHatch4PTLst】Entmake填充

[复制链接]
发表于 3 天前 | 显示全部楼层 |阅读模式
本帖最后由 kucha007 于 2025-3-29 15:09 编辑

来自此贴,多段线带凸度也可以填充。我做了一些优化
主要是可以生成双向的自定义填充,也支持UCS
如果需要返回图元名称就把entmake改为entmakeX

  1. ;点表生成填充@ElpanovEvgeniy
  2. (defun T:MakeHatch4PTLst (WCSLst PatNam PatLay PatCol PatSca)
  3.     (entmake
  4.       (apply
  5.         'append
  6.         (list
  7.           (list
  8.             (cons 0 "HATCH")
  9.             (cons 100 "AcDbEntity")
  10.             (cons 410 "Model")
  11.             (cons 100 "AcDbHatch")
  12.             (cons 10 '(0.0 0.0 0.0))
  13.             (cons 210 (trans '(0 0 1) 1 0 T ))
  14.             (if (wcmatch PatNam "_U*")
  15.                 (cons 2 "_USER")
  16.                 (cons 2 PatNam)
  17.             )
  18.             (cons 8 (if PatLay PatLay "0"))
  19.             (cons 62 (if (and PatCol (< 0 (abs PatCol) 256)) PatCol 7))
  20.             (cons 70 0);实体填充?
  21.             (cons 71 0)
  22.             (cons 91 (length WCSLst))
  23.           )
  24.           (apply
  25.             'append
  26.             (mapcar
  27.               '(lambda (XX)
  28.                 (apply
  29.                   'append
  30.                   (list
  31.                     (list (cons 92 7) (cons 72 1) (cons 73 1) (cons 93 (/ (length XX) 2)))
  32.                     XX
  33.                     (list (cons 97 0))
  34.                   )
  35.                 )
  36.               )
  37.               WCSLst
  38.             )
  39.           )
  40.           (list
  41.             (cons 75 0)
  42.             (cons 76 1)
  43.             (cons 52 (- 0.0 (angle '(0 0 0) (trans (getvar "UCSXDIR") 0 (trans '(0 0 1) 1 0 T )))))
  44.             (cons 41 PatSca)
  45.             (if (and
  46.                   (wcmatch PatNam "_U*")
  47.                   (wcmatch PatNam "*-D")
  48.                 )
  49.                 (cons 77 1);双向
  50.                 (cons 77 0)
  51.             )
  52.             (cons 78 1)
  53.             (cons 53 (- 0.0 (angle '(0 0 0) (trans (getvar "UCSXDIR") 0 (trans '(0 0 1) 1 0 T )))))
  54.             (cons 43 0.)
  55.             (cons 44 0.)
  56.             (cons 45 1.)
  57.             (cons 46 1.)
  58.             (cons 79 0)
  59.             (cons 47 1.)
  60.             (cons 98 2)
  61.             (cons 10 '(0.0 0.0 0.0))
  62.             (cons 10 '(0.0 0.0 0.0))
  63.             (cons 451 0)
  64.             (cons 460 0.0)
  65.             (cons 461 0.0)
  66.             (cons 452 1)
  67.             (cons 462 1.0)
  68.             (cons 453 2)
  69.             (cons 463 0.0)
  70.             (cons 463 1.0)
  71.             (cons 470 "LINEAR")
  72.           )
  73.         )
  74.       )
  75.     )
  76. )



本帖子中包含更多资源

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

x
回复

使用道具 举报

发表于 3 天前 | 显示全部楼层
感谢分享,收藏备用
回复 支持 反对

使用道具 举报

发表于 前天 22:46 | 显示全部楼层
410组码改下子

  • (cons 410 (getvar "ctab"))

回复 支持 反对

使用道具 举报

 楼主| 发表于 前天 23:42 | 显示全部楼层

本来想改,测试改不改都能生成,就没改了
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-4-1 08:24 , Processed in 0.177194 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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