SPARKY77,
非常感谢,它几乎成功了!事实上,如果没有修改圆柱体端部,或者从中减去相同直径的圆柱体,则效果相当好。
下面是一个测试命令,将创建3个圆柱体来演示该条件。在它创建的红色圆柱体上使用test命令,您就会明白我的意思。
- (defun c:test2 ( / ss1)
- ;; Create 3 cylinders, one of which is shaped to fit the other two.
- (command ".ucs" "W")
- ;; Create the two chord cylinders (that will be subtracted).
- (command ".cylinder" "0,0,0" 2.0 10.0)
- (setq ss1 (ssadd (entlast)))
- (command ".cylinder" "10,0,0" 1.0 10.0)
- (ssadd (entlast) ss1)
-
- (command ".vpoint" "1,-1,1")
-
- ;; Create the cylinders and fit the ends to the first two cylinders.
- (command ".ucs" "ZA" "10,0,2" "0,0,8")
- (command ".color" "r")
- (command ".cylinder" "0,0,0" 1.0 11.66190379)
- ;; Cope both ends to fit the chord cylinders.
- (command ".subtract" (entlast) "" ss1 "")
- ;; Recreate the two cylinders deleted by the subtract command.
- (command ".ucs" "W")
- (command ".color" "y")
- (command ".cylinder" "0,0,0" 2.0 10.0)
- (command ".cylinder" "10,0,0" 1.0 10.0)
- (command ".color" "w")
- (alert "Try the 'test' command on the red cylinder. It reports the height of the cylinder is 0.0 units and p1 and p2 are identical.")
- ) ;_ defun c:test2
Footpeg |