本帖最后由 cabinsummer 于 2011-10-30 23:57 编辑
以下代码由块插入实现功能
- (setvar "cmdecho" 0)
- (setvar "osmode" 0)
- (entmake '((0 . "block")(10 0 0 0)(70 . 0)(2 . "M10")))
- (command "clayer" "0")
- (entmake '((0 . "circle")(10 0 0 0)(40 . 4.35)(8 . "0")))
- (entmake '((0 . "arc")(10 0 0 0)(40 . 5)(50 . 0)(51 . 4.72)(62 . 2)(8 . "螺纹")))
- (entmake '((0 . "line")(10 -6 0 0)(11 6 0 0)(62 . 1)(8 . "中心线")))
- (entmake '((0 . "line")(10 0 -6 0)(11 0 6 0)(62 . 1)(8 . "中心线")))
- (setq blkname (entmake '((0 . "endblk"))))
- (princ)
- (defun c:M10(/ p)
- (setvar "cmdecho" 0)
- (setq p (getpoint "Enter the center:"))
- (entmake (list '(0 . "insert")(cons 2 blkname)(cons 10 p)))
- (princ)
- )
|