乐筑天下

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

[编程交流] 3D螺栓创建例行测试

[复制链接]

1

主题

7

帖子

6

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 10:51:37 | 显示全部楼层 |阅读模式
我终于把脚趾伸进了Lisp程序的水池,这是我第一次尝试
 
首先,我不得不将代码分为两部分,因为帖子中最多有10000个字符,很抱歉。
 
下面的程序应该在两个选定的3D板上“钻”一个clearace孔,每个板的厚度不超过70mm。然后绘制一个3D公制螺母、螺栓和垫圈,将两块板栓接在一起。可用的螺栓尺寸为M4至M30(仅限首选尺寸)。
 
首先,必须在需要钻孔的一个面上,在需要螺栓孔的位置放置一个点。
 
加载后,在命令行上键入:mbolt,然后按照提示操作。
 
所有用于改进或修复错误的输入都将受到极大的赞赏,但是,请注意,对于lisp,我是一个完全的新手,因此我仍然不熟悉所有的命令、约定或语法。
 
好了,开始了!
回复

使用道具 举报

1

主题

7

帖子

6

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 10:55:15 | 显示全部楼层
第1部分:
 
  1. ;c:m4bolt drills hole in two pieces of steel and creates M4 bolt of appropriate length, nut and washers         ^c^c(if (not c:m4bolt)(load "dcbolt.fas"));m4bolt
  2. ;c:m5bolt drills hole in two pieces of steel and creates M5 bolt of appropriate length, nut and washers         ^c^c(if (not c:m5bolt)(load "dcbolt.fas"));m5bolt
  3. ;c:m6bolt drills hole in two pieces of steel and creates M6 bolt of appropriate length, nut and washers         ^c^c(if (not c:m6bolt)(load "dcbolt.fas"));m6bolt
  4. ;c:m8bolt drills hole in two pieces of steel and creates M8 bolt of appropriate length, nut and washers         ^c^c(if (not c:m8bolt)(load "dcbolt.fas"));m8bolt
  5. ;c:m10bolt drills hole in two pieces of steel and creates M10 bolt of appropriate length, nut and washers       ^c^c(if (not c:m10bolt)(load "dcbolt.fas"));m10bolt
  6. ;c:m12bolt drills hole in two pieces of steel and creates M12 bolt of appropriate length, nut and washers       ^c^c(if (not c:m12bolt)(load "dcbolt.fas"));m12bolt
  7. ;c:m16bolt drills hole in two pieces of steel and creates M16 bolt of appropriate length, nut and washers       ^c^c(if (not c:m16bolt)(load "dcbolt.fas"));m16bolt
  8. ;c:m20bolt drills hole in two pieces of steel and creates M20 bolt of appropriate length, nut and washers       ^c^c(if (not c:m20bolt)(load "dcbolt.fas"));m20bolt
  9. ;c:m24bolt drills hole in two pieces of steel and creates M24 bolt of appropriate length, nut and washers       ^c^c(if (not c:m24bolt)(load "dcbolt.fas"));m24bolt
  10. ;c:m30bolt drills hole in two pieces of steel and creates M30 bolt of appropriate length, nut and washers       ^c^c(if (not c:m30bolt)(load "dcbolt.fas"));m30bolt
  11. (defun c:m4bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  12. (setq msize 4.00)        ;metric bolt size
  13. (setq holedia 5.00)        ;clearance hole dia
  14. (setq len1 -70.00)        ;max depth of drilled hole
  15. (setq washerd 9.00)        ;washer o/d
  16. (setq washert 0.80)        ;washer thickness
  17. (setq boltaf 3.50)        ;half dim across flats
  18. (setq boltthk 2.90)        ;depth of bolt head
  19. (setq nutthk 3.00)        ;depth of nut
  20. (setq ext1 5.00)        ;min extension past nut face
  21. (setq boltend 0.25)        ;sets chamfer on end of bolt
  22. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  23. )
  24. (defun c:m5bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  25. (setq msize 5.00)        ;metric bolt size
  26. (setq holedia 6.00)        ;clearance hole dia
  27. (setq len1 -70.00)        ;max depth of drilled hole
  28. (setq washerd 10.00)        ;washer o/d
  29. (setq washert 1.00)        ;washer thickness
  30. (setq boltaf 4.00)        ;half dim across flats
  31. (setq boltthk 3.60)        ;depth of bolt head
  32. (setq nutthk 4.00)        ;depth of nut
  33. (setq ext1 5.00)        ;min extension past nut face
  34. (setq boltend 0.25)        ;sets chamfer on end of bolt
  35. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  36. )
  37. (defun c:m6bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  38. (setq msize 6.00)        ;metric bolt size
  39. (setq holedia 7.00)        ;clearance hole dia
  40. (setq len1 -70.00)        ;max depth of drilled hole
  41. (setq washerd 12.50)        ;washer o/d
  42. (setq washert 1.6)        ;washer thickness
  43. (setq boltaf 5.00)        ;half dim across flats
  44. (setq boltthk 4.00)        ;depth of bolt head
  45. (setq nutthk 5.00)        ;depth of nut
  46. (setq ext1 5.00)        ;min extension past nut face
  47. (setq boltend 0.50)        ;sets chamfer on end of bolt
  48. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  49. )
  50. (defun c:m8bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  51. (setq msize 8.00)        ;metric bolt size
  52. (setq holedia 10.00)        ;clearance hole dia
  53. (setq len1 -70.00)        ;max depth of drilled hole
  54. (setq washerd 17.00)        ;washer o/d
  55. (setq washert 1.6)        ;washer thickness
  56. (setq boltaf 6.50)        ;half dim across flats
  57. (setq boltthk 5.50)        ;depth of bolt head
  58. (setq nutthk 6.50)        ;depth of nut
  59. (setq ext1 5.00)        ;min extension past nut face
  60. (setq boltend 0.50)        ;sets chamfer on end of bolt
  61. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  62. )
  63. (defun c:m10bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  64. (setq msize 10.00)        ;metric bolt size
  65. (setq holedia 12.00)        ;clearance hole dia
  66. (setq len1 -70.00)        ;max depth of drilled hole
  67. (setq washerd 21.00)        ;washer o/d
  68. (setq washert 2.00)        ;washer thickness
  69. (setq boltaf 8.50)        ;half dim across flats
  70. (setq boltthk 7.00)        ;depth of bolt head
  71. (setq nutthk 8.00)        ;depth of nut
  72. (setq ext1 5.00)        ;min extension past nut face
  73. (setq boltend 0.75)        ;sets chamfer on end of bolt
  74. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  75. )
  76. (defun c:m12bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  77. (setq msize 12.00)        ;metric bolt size
  78. (setq holedia 14.00)        ;clearance hole dia
  79. (setq len1 -70.00)        ;max depth of drilled hole
  80. (setq washerd 24.00)        ;washer o/d
  81. (setq washert 2.50)        ;washer thickness
  82. (setq boltaf 9.50)        ;half dim across flats
  83. (setq boltthk 8.00)        ;depth of bolt head
  84. (setq nutthk 10.00)        ;depth of nut
  85. (setq ext1 5.00)        ;min extension past nut face
  86. (setq boltend 1.0)        ;sets chamfer on end of bolt
  87. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  88. )
  89. (defun c:m16bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  90. (setq msize 16.00)        ;metric bolt size
  91. (setq holedia 18.00)        ;clearance hole dia
  92. (setq len1 -70.00)        ;max depth of drilled hole
  93. (setq washerd 30.00)        ;washer o/d
  94. (setq washert 3.00)        ;washer thickness
  95. (setq boltaf 12.00)        ;half dim across flats
  96. (setq boltthk 10.00)        ;depth of bolt head
  97. (setq nutthk 13.00)        ;depth of nut
  98. (setq ext1 5.00)        ;min extension past nut face
  99. (setq boltend 1.25)        ;sets chamfer on end of bolt
  100. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  101. )
  102. (defun c:m20bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  103. (setq msize 20.00)        ;metric bolt size
  104. (setq holedia 22.00)        ;clearance hole dia
  105. (setq len1 -70.00)        ;max depth of drilled hole
  106. (setq washerd 37.00)        ;washer o/d
  107. (setq washert 3.00)        ;washer thickness
  108. (setq boltaf 15.00)        ;half dim across flats
  109. (setq boltthk 13.00)        ;depth of bolt head
  110. (setq nutthk 16.00)        ;depth of nut
  111. (setq ext1 5.00)        ;min extension past nut face
  112. (setq boltend 1.5)        ;sets chamfer on end of bolt
  113. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  114. )
  115. (defun c:m24bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  116. (setq msize 24.00)        ;metric bolt size
  117. (setq holedia 28.00)        ;clearance hole dia
  118. (setq len1 -70.00)        ;max depth of drilled hole
  119. (setq washerd 44.00)        ;washer o/d
  120. (setq washert 4.00)        ;washer thickness
  121. (setq boltaf 18.00)        ;half dim across flats
  122. (setq boltthk 15.00)        ;depth of bolt head
  123. (setq nutthk 19.00)        ;depth of nut
  124. (setq ext1 5.00)        ;min extension past nut face
  125. (setq boltend 1.75)        ;sets chamfer on end of bolt
  126. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  127. )
  128. (defun c:m30bolt ( / msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  129. (setq msize 30.00)        ;metric bolt size
  130. (setq holedia 34.00)        ;clearance hole dia
  131. (setq len1 -70.00)        ;max depth of drilled hole
  132. (setq washerd 56.00)        ;washer o/d
  133. (setq washert 4.00)        ;washer thickness
  134. (setq boltaf 23.00)        ;half dim across flats
  135. (setq boltthk 19.00)        ;depth of bolt head
  136. (setq nutthk 24.00)        ;depth of nut
  137. (setq ext1 5.00)        ;min extension past nut face
  138. (setq boltend 2.00)        ;sets chamfer on end of bolt
  139. (dcbolt msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend)
  140. )
  141. ;------------------------------------------------------------------------------------------------------------------
  142. (defun dcbolt (msize holedia len1 washerd washert boltaf boltthk nutthk ext1 boltend / cm olderr attrerr *error* exsnaps
  143.        curlayer layername colour linetype curlayer2 p1 objtypa ent1 enta entdataa objtypb ent2 entb entdatab
  144.        cyl3 cyl4 washer1 list1 b1 b2 p2 p3 p4d p4 p5d p5 b3 b4 bolthead p6 p7 p8 len2 len3 len4 len5 len6 len7 len8
  145.        len9 b5 msizer p9d p9 len10 p10 p11 b6 b7 shank bolt list2 cyl5 cyl6 washer2 list3 b9 b10 p12 p13 p14
  146.        b11 b12 p15 p16 len11 p17 b13 b14 b15 b16 b17 nut)
  147. ;------------------------------------------------------------------------------------------------------------------
回复

使用道具 举报

1

主题

7

帖子

6

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 10:58:35 | 显示全部楼层
第2部分:
 
  1.   ;set error handler and save current settings
  2. (setq cm (getvar "cmdecho"))
  3. (setvar "cmdecho" 0)
  4. ;(textscr)
  5. (setq olderr *error*)
  6. (setq *error* attrerr)
  7. (command "_.undo" "_group")
  8. (setq exsnaps (getvar "osmode"))
  9. (command "_ucs" "na" "d" "existing")
  10. (command "_ucs" "na" "s" "existing")
  11. ;save current layer status and create layer "bolting"
  12. (setq curlayer (getvar "clayer"))
  13. (setq layername (strcat curlayer " BOLTING"))
  14. (setq colour "8")
  15. (setq linetype "continuous")
  16. (layerset layername colour linetype)
  17. (setq curlayer2 (getvar "clayer"))
  18. ;bolt routine start-----------------------------------------------------------------------------------------------
  19. (setvar "osmode" 127)
  20. ;set face ucs to face
  21. (command "ucs" "na" "d" "existing")
  22. (princ "Pick face to be drilled")
  23. (command "ucs" "NA" "S" "existing")
  24. (command "ucs" "f" pause "")
  25. ;set hole center
  26. (initget 1)
  27. (setq p1 (getpoint "\nPick hole center point:"))
  28. ;move ucs to hole center
  29. (command "_ucs" "_o" p1)
  30. ;pick second solid to be drilled
  31. (while (/= objtypa "3DSOLID")
  32.    (setq ent1 (entsel "\nPick solids to be drilled:"))
  33.    (if ent1
  34.      (progn
  35. (setq enta (car ent1))
  36. (setq entdataa (entget enta))
  37. (setq objtypa (cdr (assoc 0 entdataa)))
  38. )
  39.      )
  40.    )
  41. ;pick second solid to be drilled
  42. (while (/= objtypb "3DSOLID")
  43.    (setq ent2 (entsel "\nPick solids to be drilled:"))
  44.    (if ent2
  45.      (progn
  46. (setq entb (car ent2))
  47. (setq entdatab (entget entb))
  48. (setq objtypb (cdr (assoc 0 entdatab)))
  49. )
  50.      )
  51.    )
  52. ;create cylinders and subtract from selected solids to "drill" hole
  53. (command "_cylinder" "0,0,0" "d" holedia len1)
  54. (setq cyl1 (entlast))
  55. (command "_subtract" ent1 "" cyl1 "")
  56. (command "_cylinder" "0,0,0" "d" holedia len1)
  57. (setq cyl2 (entlast))
  58. (command "_subtract" ent2 "" cyl2 "")
  59. ;create washer 1
  60. (command "_cylinder" "0,0,0" "d" washerd washert)
  61. (setq cyl3 (entlast))
  62. (command "_cylinder" "0,0,0" "d" holedia washert)
  63. (setq cyl4 (entlast))
  64. (command "_subtract" cyl3 "" cyl4 "")
  65. (setq washer1 (entlast))
  66. ;create bolt head
  67. (command "_osmode" 0)
  68. (setq list1 (list 0 0 washert))
  69. (command "_ucs" "_o" list1)
  70. (command "_polygon" "6" "0,0,0" "c" boltaf)
  71. (setq b1 (entlast))
  72. (command "_extrude" b1 "" boltthk)
  73. (setq b2 (entlast))
  74. (setq p2 (list 0 0 boltthk))
  75. (setq p3 (list boltaf 0 boltthk))
  76. (setq p4d (+ 20 boltaf))
  77. (setq p4 (list p4d 0 boltthk))
  78. (setq p5d (- boltthk 11.55))
  79. (setq p5 (list p4d 0 p5d))
  80. (command "_osmode" 0)
  81. (command "_3dpoly" p3 p4 p5 "c")
  82. (setq b3 (entlast))
  83. (command "_revolve" b3 "" "0,0,10" "0,0,0" "360")
  84. (setq b4 (entlast))
  85. (command "_subtract" b2 "" b4 "")
  86. (setq bolthead (entlast))
  87. ;select back face
  88. (setvar "osmode" 4)
  89. (initget 1)
  90. (setq p6 (getpoint "\nSet length of bolt by picking back face hole center:"))
  91. (command "osmode" 0)
  92. ;calculate bolt grip length
  93. (setq p7 (list 0 0 0))
  94. (setq len2 (distance p6 p7))
  95. (setq len3 (+ len2 washert))
  96. (setq len4 (+ len3 nutthk))
  97. (setq len5 (/ len4 5))
  98. (setq len6 (fix len5))
  99. (setq len7 (+ 1 len6))
  100. (setq len8 (* 5 len7))
  101. (setq len9 (+ len8 ext1))
  102. ;create bolt shank
  103. (command "_osmode" 0)
  104. (command "_ucs" "_y" "180")
  105. (command "_cylinder" "0,0,0" "d" msize len9)
  106. (setq b5 (entlast))
  107. (setq msizer (/ msize 2))
  108. (setq p9d (- msizer boltend))
  109. (setq p9 (list p9d 0 len9))
  110. (setq len10 (- len9 boltend))
  111. (setq p10 (list msizer 0 len10))
  112. (setq p11 (list msizer 0 len9))
  113. (command "_osmode" 0)
  114. (command "_3dpoly" p9 p10 p11 "c")
  115. (setq b6 (entlast))
  116. (command "_revolve" b6 "" "0,0,10" "0,0,0" "360")
  117. (setq b7 (entlast))
  118. (command "_subtract" b5 "" b7 "")
  119. (setq shank (entlast))
  120. ;join bolt head to shank
  121. (command "_union" bolthead shank "")
  122. (setq bolt (entlast))
  123. ;create washer 2
  124. (setq list2 (list 0 0 len2))
  125. (command "_ucs" "_o" list2)
  126. (command "_osmode" 0)
  127. (command "_cylinder" "0,0,0" "d" washerd washert)
  128. (setq cyl5 (entlast))
  129. (command "_cylinder" "0,0,0" "d" holedia washert)
  130. (setq cyl6 (entlast))
  131. (command "_subtract" cyl5 "" cyl6 "")
  132. (setq washer2 (entlast))
  133. ;create nut
  134. (setq list3 (list 0 0 washert))
  135. (command "_ucs" "_o" list3)
  136. (command "_polygon" "6" "0,0,0" "c" boltaf)
  137. (setq b9 (entlast))
  138. (command "_extrude" b9 "" nutthk)
  139. (setq b10 (entlast))
  140. (setq p12 (list boltaf 0 0))
  141. (setq p13 (list p4d 0 0))
  142. (setq p14 (list p4d 0 11.55))
  143. (command "_3dpoly" p12 p13 p14 "c")
  144. (setq b11 (entlast))
  145. (command "_revolve" b11 "" "0,0,10" "0,0,0" "360")
  146. (setq b12 (entlast))
  147. (command "_subtract" b10 "" b12 "")
  148. (setq b13 (entlast))
  149. (setq p15 (list boltaf 0 nutthk))
  150. (setq p16 (list p4d 0 nutthk))
  151. (setq len11 (- nutthk 11.55))
  152. (setq p17 (list p4d 0 len11))
  153. (command "_3dpoly" p15 p16 p17 "c")
  154. (setq b14 (entlast))
  155. (command "_revolve" b14 "" "0,0,10" "0,0,0" "360")
  156. (setq b15 (entlast))
  157. (command "_subtract" b13 "" b15 "")
  158. (setq b16 (entlast))
  159. (command "_cylinder" "0,0,0" "d" msize nutthk)
  160. (setq b17 (entlast))
  161. (command "_subtract" b13 "" b17 "")
  162. (setq nut (entlast))
  163. ;bolt routine finishes--------------------------------------------------------------------------------------------
  164. ;restore all original settings
  165. (command "_osmode" exsnaps)
  166. (command "_ucs" "na" "r" "existing")
  167. (command "_ucs" "na" "d" "existing")
  168. (command "_layer" "s" curlayer "")
  169. (command "_undo" "_end")
  170. (setq *error* olderr)
  171. (princ)
  172. )
  173. ;internal error handler
  174. (defun attrerr (str /)
  175. (if (/= str "Function Cancelled")
  176.    (princ (strcat "\nError: "str))
  177.    )
  178. ;end of prog statement
  179. (command "_undo" "_end")
  180. (command "_undo" "1")
  181. ;restore old error handler
  182. (setq *error* olderr)
  183. (setvar "cmdecho" cm)
  184. (princ)
  185. )
  186. ;sub routines------------------------------------------------------------------------------------------------------
  187. ;subroutine for creating layer
  188. (defun layerset (layername colour linetype / )
  189. (if (/= colour nil)
  190.    (command "_layer" "m" layername "c" colour layername "lt" linetype layername "")
  191.    )
  192. )
回复

使用道具 举报

1

主题

7

帖子

6

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 11:03:27 | 显示全部楼层
请注意,例程应基于当前层为紧固件创建一个新层。一、 e.如果您在一个名为“钢结构”的层上,则应创建一个名为“钢结构螺栓连接”的新层。
 
我想改进但不知道如何改进的事情:
 
1) 目前,初始孔的设置深度只能为70mm。我认为,如果孔深度可以从您尝试“钻孔”的三维实体的深度中获取,则会更好。这样可以将更厚的物品固定在一起。这可能吗?
 
2) 这个例程只允许你将两个项目连接在一起,有没有办法让它允许选择两个以上的项目?
 
3) 如果由于某种原因,例程中途崩溃,它不会将所有内容恢复到其原始状态(UCS、层等),这真的很烦人。在试验过程中,我最终创建了以下层:
钢结构螺栓连接
钢结构螺栓
钢结构螺栓
钢结构螺栓等。有没有办法退回所有东西并阻止这种情况?
 
还有其他改进意见吗?
 
非常感谢。
回复

使用道具 举报

1

主题

7

帖子

6

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 11:04:42 | 显示全部楼层
哦,是的,我差点忘了。代码的第一部分说明了如果要创建工具栏或菜单,需要在命令行上键入什么,以及在按钮中输入什么。
回复

使用道具 举报

1

主题

61

帖子

65

银币

初来乍到

Rank: 1

铜币
4
发表于 2022-7-6 11:08:33 | 显示全部楼层
太酷了!我不得不尝试一下,只是为了看看它是如何工作的。很酷,现在如果有人可以在螺母和螺栓上创建螺纹。。。。大声笑。。。干得好Cerberus!!哦,顺便说一句,它只创建了1层,0个螺栓。我从一个设置为毫米单位的新图形开始,似乎运行得很协调。这是一个屏幕截图
115137dyyur9d1n9da0mrv.jpg
回复

使用道具 举报

CAB

29

主题

781

帖子

430

银币

中流砥柱

Rank: 25

铜币
526
发表于 2022-7-6 11:12:59 | 显示全部楼层
第一次尝试看起来很不错。
 
我附上了修订版。只是另一种方法,我篡改了你的WHILE语句。
 
我没有测试,所以如果有任何错误,请原谅我。
我只是提供一些变化。我没时间了。
 
见附件。
闩LSP
回复

使用道具 举报

0

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 11:14:47 | 显示全部楼层
有人可以澄清一下如何启动LISP过程,它似乎不适合我,加载好你。。。。。。
回复

使用道具 举报

180

主题

639

帖子

463

银币

中流砥柱

Rank: 25

铜币
897
发表于 2022-7-6 11:19:09 | 显示全部楼层
我不是LISP程序员,但我安装并成功运行了它。我可以使用绘制螺栓头的部分,所以我研究了代码,得到了足够多的代码,只是感到困惑。也许有人能帮我,因为我真的很想为我的3D工作画一些细节。
 
正如我在绘制螺栓头的部分所看到的,这家伙:
 
a) 。绘制六边多边形
b) 。将其挤出到所需的厚度
c) 。然后他画了一条我似乎无法理解的三维多段线。他挑了几个要点,但我似乎无法理解其中的逻辑。
d) 。然后他从六边形中减去这条3dpoly线,或者反过来。
 
无论如何,如果有人能在这里提供一些建议,也许我可以使用这种方法来构建我的3D螺母和螺栓。
 
顺便说一句,我按照所有步骤关闭snap等。。。这就是我遇到麻烦的3dpolyline。如果我能把那个部分取下来,这看起来像是一个非常简单的方法来绘制一些漂亮的3D螺栓头。
回复

使用道具 举报

1

主题

7

帖子

6

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 11:22:19 | 显示全部楼层
账单
 
该例程围绕螺栓中心旋转该多段线,然后将其从六边形形状中减去。这就是围绕螺栓顶部以及螺母顶部和底部创建倒角的原因。
 
为螺栓头拾取中心点后,它会将UCS原点设置到此点。多边形是使用关于这个新原点的笛卡尔坐标绘制的。例程完成后,UCS应返回其原始位置和方向。
 
希望这有帮助。
 
顺便说一句,自从发布这个命令以来,我稍微改进了这个例程,这样当你在命令执行到一半的时候按escape键时,它就不会尴尬地崩溃。
 
我还在开发一个版本,创建内六角螺钉和平头螺钉。我会尽快张贴它完成。
 
不过,我仍然没有想出如何选择两个以上的板来栓接在一起。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-6 17:07 , Processed in 1.388730 second(s), 74 queries .

© 2020-2025 乐筑天下

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