明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: raimo

[资源] 预设常用填充V1.2——用LISP来快速完成常用填充

    [复制链接]
发表于 2020-2-24 19:04:32 | 显示全部楼层
有源必须顶一下
发表于 2020-4-10 10:49:03 | 显示全部楼层
一般墙体.玻璃.300x300,600x600,实体.梁.地板.木纹这类填充用得最多
发表于 2020-7-1 08:56:17 | 显示全部楼层
软件真的不错 试试看
发表于 2020-7-1 09:25:11 | 显示全部楼层
谢谢楼主分享
发表于 2020-7-1 11:30:02 | 显示全部楼层
chaozhong116 发表于 2020-4-10 10:49
一般墙体.玻璃.300x300,600x600,实体.梁.地板.木纹这类填充用得最多

用我改的那一版本基本可以达到了!有20个常用材质!
发表于 2020-8-25 17:51:44 | 显示全部楼层
谢谢楼主,厉害 了
发表于 2023-9-18 21:26:34 | 显示全部楼层
感谢分享,大佬厉害
发表于 2023-11-16 22:10:52 | 显示全部楼层
小毛草 发表于 2020-7-1 11:30
用我改的那一版本基本可以达到了!有20个常用材质!

图层一直改不过来?一直是t填充?

本帖子中包含更多资源

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

x
发表于 2023-11-17 11:23:24 | 显示全部楼层
  1. ;;预设常用 -------------------- TC
  2. ;;V1.2      
  3. ;;优化代码,去掉拼凑代码重新设计
  4. ;;增加记忆功能,提高填充的使用方便性
  5. ;;在V1.1的基础上实现点选,与对象选择并存,并且都可以多选。

  6. ;;----------------------------------
  7. (defun c:TC (/ opt oldcolor num_HType *num_HType* ss )
  8. (setvar "measurement" 1)     ; 设置公制单位
  9. (setvar "cmdecho" 0)         ; 关闭命令响应
  10. (setq oldcolor (getvar "cecolor"))
  11. (command "_layer"   "m"   "4BD-METAL"    "c" "201" ""    "l" "c" ""   "")
  12. (setvar "clayer" "4BD-METAL")
  13. (if *num_HType*
  14.   (setq num_HType (getint (strcat "\n选择填充样式  ①BD玻璃实体 ②BD金属实体 ③拉丝80 ④地砖300 ⑤地砖800 ⑥木地板 ⑦木夹板 ⑧木纹 ⑨钢砼: <" (rtos *num_HType* 2 0) ">")))
  15.   (setq num_HType (getint "\n选择填充样式  ①BD玻璃实体 ②BD金属实体 ③拉丝80 ④地砖300 ⑤地砖800 ⑥木地板 ⑦木夹板 ⑧木纹 ⑨钢砼: " ))
  16. )
  17. (if (not num_HType)
  18.   (setq num_HType *num_HType*)
  19.   (setq *num_HType* num_HType)
  20. )
  21. (setq opt num_HType)

  22. (if (< 0 opt 10) (eval (read(strcat "(tianchong" (itoa opt) ")"))));根据选项参数执行填充样式

  23. (if (setq ss (ssget))
  24.   (command "bhatch" "s" ss "" "") ;如果选择集不为空,则执行对象填充
  25. (progn  ;如果选择集为空,则执行点选命令
  26.   (prompt "\n请拾取填充内部点:\n")
  27.   (command "bhatch" pause)
  28.   (while (> (getvar "CMDACTIVE") 0) (command PAUSE))
  29. ))

  30. (command "color" oldcolor)
  31. (princ)
  32. )


  33. (defun tianchong1 ()
  34. (prompt "\n当前样式: ①BD玻璃实体填充\n")
  35. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  36. (command "color" "131")
  37.   (command "bhatch" "p" "solid" "")
  38. )
  39. (defun tianchong2 (/ ss)
  40. (command "_layer"   "m"   "4BD-METAL"    "c" "201" ""    "l" "c" ""   "")

  41. (prompt "\n当前样式: ②BD金属实体填充\n")
  42. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  43. (command "color" "201")
  44. (setvar "clayer" "4BD-METAL")
  45. (command "bhatch" "p" "solid" "")
  46. (setq ss (entlast))
  47. (COMMAND "CHANGE" SS "" "PROPERTIES" "la" "4BD-METAL" "")

  48. )
  49. (defun tianchong3 ()
  50. (prompt "\n当前样式: ③拉丝间距80\n")
  51. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  52. (command "color" "8")
  53. (command "bhatch" "p" "U" "0" "80" "N" "")
  54. )
  55. (defun tianchong4 ()
  56. (prompt "\n当前样式: ④300x300地砖\n")
  57. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  58. (command "color" "8")
  59. (command "bhatch" "p" "U" "0" "300" "Y" "")
  60. )
  61. (defun tianchong5 ()
  62. (prompt "\n当前样式: ⑤800x800地砖\n")
  63. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  64. (command "color" "8")
  65. (command "bhatch" "p" "U" "0" "800" "Y" "")
  66. )
  67. (defun tianchong6 ()
  68. (prompt "\n当前样式: ⑥灰色木地板\n")
  69. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  70. (command "color" "8")
  71. (command "bhatch" "p" "木地板" "80" "0" "")
  72. )
  73. (defun tianchong7 ()
  74. (prompt "\n当前样式: ⑦暗色木夹板\n")
  75. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  76. (command "color" "250")
  77. (command "bhatch" "p" "木夹板" "1" "0" "")
  78. )
  79. (defun tianchong8 ()
  80. (prompt "\n当前样式: ⑧暗色木纹\n")
  81. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  82. (command "color" "250")
  83. (command "bhatch" "p" "木纹01" "10" "0" "")
  84. )
  85. (defun tianchong9 ()
  86. (prompt "\n当前样式:  ⑨暗色钢砼\n")
  87. (prompt "\n请选择对象,跳过则为拾取内部点:\n")
  88. (command "color" "250")
  89. (command "bhatch" "p" "钢筋混凝土" "20" "0" "")
  90. )


本帖子中包含更多资源

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

x
发表于 2023-11-17 16:34:14 | 显示全部楼层
谢谢楼主,感谢分享!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-16 08:58 , Processed in 0.163347 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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