Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to adapt this bit of code I found over at http://www.theswamp.org/index.php?topic=4814.60.
(defun C:Test () (entmakex-hatch '(((0 0) (1 0) (1 1) (0 1)) ) (/ pi 2) "SOLID" 2.0 ))
(defun C:Test2 ( / a)
(setq a 1)
(entmakex-hatch '(((0 0) (a 0) (a a) (0 a)) ) (/ pi 2) "SOLID" 2.0 ))
(defun entmakex-hatch (L a n s) ;; By ElpanovEvgeniy ;; L - list point ;; A - angle hatch ;; N - name pattern ;; S - scale ;; returne - hatch ename (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) '(2 . "SOLID" ) (if (= n "SOLID") '(70 . 1) '(70 . 0) ) ;_ if '(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) (cons 52 a) (cons 41 s) '(77 . 0) '(78 . 1) (cons 53 a) '(43 . 0.) '(44 . 0.) '(45 . 1.) '(46 . 1.) '(79 . 0) '(47 . 1.) '(98 . 2) '(10 0. 0. 0.0) '(10 0. 0. 0.0) '(451 . 0) '(460 . 0.0) '(461 . 0.0) '(452 . 1) '(462 . 1.0) '(453 . 2) '(463 . 0.0) '(463 . 1.0) '(470 . "LINEAR") ) ;_ list ) ;_ list ) ;_ apply ) ;_ entmakex ) ;_ defun
The first test works well, but things start to break down when I try using variables as part of the point list,. I've tried using (list) to build my list but that just returns dxf errors.
Any advice? I'm still learning of the complexities of DXF codes so I'm sure the issues lies in there, I'm just not sure where to start.
Solved! Go to Solution.