如何通过u创建实体图案填充
你好我正在尝试使用lisp制作钻孔属性块(请参阅附件)
在这个lisp中,我需要添加实体图案填充,如所附图像所示
请帮我创建这个lisp。
谢谢®ads
比乔伊
BH块。lsp 研究AddHatch方法;特别注意开发人员文档中的边界注释。
HTH公司 在块定义中添加:
(entmake
(list
'(0 . "HATCH")
'(100 . "AcDbEntity")
'(67 . 0)
'(410 . "Model")
'(8 . "0")
'(100 . "AcDbHatch")
'(10 0.0 0.0 0.0)
'(210 0.0 0.0 1.0)
'(2 . "SOLID")
'(70 . 1)
'(71 . 0)
'(91 . 1)
'(92 . 7)
'(72 . 1)
'(73 . 1)
'(93 . 3)
'(10 0.0 2.0 0.0)
'(42 . 0.414214)
'(10 -2.0 0.0 0.0)
'(42 . 0.0)
'(10 0.0 0.0 0.0)
'(42 . 0.0)
'(97 . 0)
'(75 . 1)
'(76 . 1)
'(47 . 0.0131804)
'(98 . 1)
'(10 -1.38935 0.623746 0.0)
)
)
(entmake
(list
'(0 . "HATCH")
'(100 . "AcDbEntity")
'(67 . 0)
'(410 . "Model")
'(8 . "0")
'(100 . "AcDbHatch")
'(10 0.0 0.0 0.0)
'(210 0.0 0.0 1.0)
'(2 . "SOLID")
'(70 . 1)
'(71 . 0)
'(91 . 1)
'(92 . 7)
'(72 . 1)
'(73 . 1)
'(93 . 3)
'(10 2.0 0.0 0.0)
'(42 . 0.0)
'(10 0.0 0.0 0.0)
'(42 . 0.0)
'(10 0.0 -2.0 0.0)
'(42 . 0.414214)
'(97 . 0)
'(75 . 1)
'(76 . 1)
'(47 . 0.0131804)
'(98 . 1)
'(10 0.839759 -0.628394 0.0)
)
)
非常感谢你,医生,你让我度过了美好的一天。。 看这里
(defun entmakex-hatch (L a n s)
;; By ElpanovEvgeniy
;; L - list point
;; A - angle hatch
;; N - name pattern
;; S - scale
谢谢VVA 你好
我正在尝试学习如何用enmake方法制作实体图案填充。作为练习,我试图创建一个矩形实体图案填充,但它总是显示错误。你能检查一下下面的代码吗?请告诉我我在代码中犯的错误。让我知道哪些值可以忽略。
谢谢和问候
比乔伊。
(defun c:tp ( )
(entmake
(list
'(0 . "HATCH")
'(100 . "AcDbEntity")
'(67 . 0)
'(410 . "Model")
'(8 . "0")
'(100 . "AcDbHatch")
'(10 0.0 0.0 0.0)
'(210 0.0 0.0 1.0)
'(2 . "SOLID")
'(70 . 1)
'(71 . 1)
'(91 . 1)
'(92 . 7)
'(72 . 0)
'(73 . 1)
'(93 . 4)
'(10 0.0 2.0 0.0)
'(10 -2.0 2.0 0.0)
'(10 -2.0 0.0 0.0)
'(10 0.0 0.0 0.0)
'(97 . 3)
'(75 . 1)
'(76 . 1)
'(47 . 0.0261891)
'(98 . 1)
'(10 -0.973791 0.503782 0.0)
'(450 . 0)
'(451 . 0)
'(460 . 0.0)
'(461 . 0.0)
'(452 . 1)
'(462 . 1.0)
'(453 . 2)
'(463 . 0.0)
'(63 . 5)
'(421 . 255)
'(463 . 1.0)
'(63 . 7)
'(421 . 16777215)
'(470 . "LINEAR")
)
)
(princ)
)
(defun entmakex-solidhatch ( L )
;; L - list of list point. like ((pt11 pt12 pt13)(pt21 pt22 pt23))
;; Use
;;;(entmakex-solidhatch
;;; (list
;;; (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car (entsel "\nSelect Polyline:")))))
;;; );_list
;;; )
(entmakex
(apply
'append
(list
(list '(0 . "HATCH")
'(100 . "AcDbEntity")
'(410 . "Model")
'(100 . "AcDbHatch")
'(10 0.0 0.0 0.0)
'(210 0.0 0.0 1.0)
(cons 2 "SOLID")
'(70 . 1)
'(71 . 0)
(cons 91 (length L))
) ;_list
(apply 'append
(mapcar '(lambda (a)
(apply 'append
(list (list '(92 . 7) '(72 . 0) '(73 . 1) (cons 93 (length a)))
(mapcar '(lambda (b) (cons 10 b)) a)
'((97 . 0))
) ;_list
) ;_apply
) ;_lambda
L
) ;_mapcar
) ;_apply
(list '(75 . 0)
'(76 . 1)
'(47 . 1.)
'(98 . 2)
'(10 0. 0. 0.0)
'(10 0. 0. 0.0)
'(450 . 0)
'(451 . 0)
'(460 . 0.0)
'(461 . 0.0)
'(452 . 0)
'(462 . 0.0)
'(453 . 2)
'(463 . 0.0)
'(63 . 256)
'(463 . 1.0)
'(63 . 256)
'(470 . "LINEAR")
) ;_list
) ;_list
) ;_apply
)
)
使用
(entmakex-solidhatch
(list
(list
'(0.0 2.0 0.0)
'(-2.0 2.0 0.0)
'(-2.0 0.0 0.0)
'(0.0 0.0 0.0)
)
)
)
重要的 谢谢VVA的回复,实际上我想用lisp制作一个与之前讨论中制作的钻孔块几乎相同的试坑块。GP_先生,帮我在上面画一个实心图案。但是当我试图在新的lisp中创建实体图案填充时,它不起作用。所以需要帮助来完成这个附加的lisp,如所附的图片所示。请告诉我在制作entmake函数时的重要想法。
;;===============================================;;
;; Example by Lee Mac 2011-www.lee-mac.com ;;
;;===============================================;;
(defun c:tpb ( )
(if (not (tblsearch "BLOCK" "TPBLK"))
(progn
(if (not (tblsearch "STYLE" "Gen-Text"))
(entmake
(list
(cons 0 "STYLE")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbTextStyleTableRecord")
(cons 2 "Gen-Text")
(cons 70 0)
(cons 40 2.5)
(cons 3 "Arial.ttf")
)
)
)
(entmake
(list
(cons 0 "BLOCK")
(cons 8 "0")
(cons 370 0)
(cons 2 "TPBLK")
(cons 70 2)
(cons 4 "Block to Place Trial pit Locations")
(list 10 0.0 0.0 0.0)
)
)
(entmake
(list
(cons 0 "LWPOLYLINE")
(cons 100 "AcDbEntity")
(cons 100 "AcDbPolyline")
(cons 8 "0")
(cons 90 4)
(cons 70 1)
(list 10 -2.0 2.0)
(list 102.0 2.0)
(list 102.0 -2.0)
(list 10 -2.0 -2.0)
)
)
(entmake
(list
(cons 0 "LINE")
(cons 8 "0")
(cons 6 "Continuous")
(cons 370 0)
(list 10 0.0 -3.0 0.0)
(list 11 0.0 3.0 0.0)
)
)
(entmake
(list
(cons 0 "LINE")
(cons 8 "0")
(cons 6 "Continuous")
(cons 370 0)
(list 10 -3.0 0.0 0.0)
(list 11 3.0 0.0 0.0)
)
)
(entmake
(list
(cons 0 "ATTDEF")
(cons 8 "0")
(cons 370 0)
(cons 7 "Gen-Text")
(list 10 2.5 3.5 0.0)
(list 11 2.5 3.5 0.0)
(cons 40 3.5)
(cons 1 "TP-00")
(cons 3 "Trial pit Location")
(cons 2 "TP")
(cons 70 0)
(cons 72 0)
(cons 74 2)
)
)
(entmake
(list
(cons 0 "ENDBLK")
(cons 8 "0")
)
)
)
)
(princ)
)
谢谢和问候
比乔伊。v、 m
(defun c:tpb ( )
(if (not (tblsearch "BLOCK" "TPBLK"))
(progn
(if (not (tblsearch "STYLE" "Gen-Text"))
(entmake
(list
(cons 0 "STYLE")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbTextStyleTableRecord")
(cons 2 "Gen-Text")
(cons 70 0)
(cons 40 2.5)
(cons 3 "Arial.ttf")
)
)
)
(entmake
(list
(cons 0 "BLOCK")
(cons 8 "0")
(cons 370 0)
(cons 2 "TPBLK")
(cons 70 2)
(cons 4 "Block to Place Trial pit Locations")
(list 10 0.0 0.0 0.0)
)
)
(entmake
(list
(cons 0 "LWPOLYLINE")
(cons 100 "AcDbEntity")
(cons 100 "AcDbPolyline")
(cons 8 "0")
(cons 90 4)
(cons 70 1)
(list 10 -2.0 2.0)
(list 102.0 2.0)
(list 102.0 -2.0)
(list 10 -2.0 -2.0)
)
)
(entmake
(list
(cons 0 "LINE")
(cons 8 "0")
(cons 6 "Continuous")
(cons 370 0)
(list 10 0.0 -3.0 0.0)
(list 11 0.0 3.0 0.0)
)
)
(entmake
(list
(cons 0 "LINE")
(cons 8 "0")
(cons 6 "Continuous")
(cons 370 0)
(list 10 -3.0 0.0 0.0)
(list 11 3.0 0.0 0.0)
)
)
(entmake
(list
(cons 0 "ATTDEF")
(cons 8 "0")
(cons 370 0)
(cons 7 "Gen-Text")
(list 10 2.5 3.5 0.0)
(list 11 2.5 3.5 0.0)
(cons 40 3.5)
(cons 1 "TP-00")
(cons 3 "Trial pit Location")
(cons 2 "TP")
(cons 70 0)
(cons 72 0)
(cons 74 2)
)
)
(entmakex-solidhatch
(list
(list
'(0.0 2.0 0.0)
'(-2.0 2.0 0.0)
'(-2.0 0.0 0.0)
'(0.0 0.0 0.0)
)
(list
'(2.0 0.0 0.0)
'(2.0 -2.0 0.0)
'(0.0 -2.0 0.0)
'(0.0 0.0 0.0)
)
)
)
(entmake
(list
(cons 0 "ENDBLK")
(cons 8 "0")
)
)
)
)
(princ)
)
entmakex solidhatch从#8获取
页:
[1]
2