Skip to content

Commit

Permalink
add config
Browse files Browse the repository at this point in the history
  • Loading branch information
haidong ma committed Oct 23, 2019
1 parent e6c186d commit a1e1e48
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test.lsp
**/*.orig
tags

.DS_Store
5 changes: 3 additions & 2 deletions caad.lsp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
(princ "\n ---caad.lsp loading---\n")

;caad库文件
(load "config.lsp")
(load "util.lsp")
(load "geom.lsp")

;; wall & openning
(load "wallx.lsp")
(load "wall.lsp")
;(load "wallx.lsp")
(load "walld.lsp")

;; symbole
(load "bubble.lsp")
Expand Down
6 changes: 6 additions & 0 deletions config.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
;; A real number defining the maximum amount by which expr1 and expr2 can differ
;; and still be considered equal.
(setq Conf-AutoCAD-Version 2015)



25 changes: 25 additions & 0 deletions geom.lsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@
)
)

;; function of entmake lwpolyline
;; isClosed: 0 or 1 , 1=closed
(defun Geom-Entmakepolyline (pointList isClosed / conf-isClosed)
(setq conf-isClosed (cons 70 isClosed))
(if (= Conf-AutoCAD-Version 2015)
(entmakex
(append
(list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline")
(cons 90 (length pointList))
conf-isClosed
) ;_ list
(mapcar '(lambda (x) (cons 10 x)) pointList)
) ;_ append
)
(entmakex
(append
(list '(0 . "LWPOLYLINE")
(cons 90 (length pointList))
conf-isClosed
) ;_ list
(mapcar '(lambda (x) (cons 10 x)) pointList)
) ;_ append
))
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;retrieve the Entity Data;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19 changes: 3 additions & 16 deletions wall.lsp → walld.lsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;;; Main function
;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun c:wall (/ p1 plist w1 w1a w2 w2a w1lst w2lst anglist seglist seg1list seg2list)
(defun c:walld (/ p1 plist w1 w1a w2 w2a w1lst w2lst anglist seglist seg1list seg2list)
"设置wall的宽度"
(setq w1 10
w1a 10
Expand Down Expand Up @@ -35,8 +35,8 @@
(setq seg2list (segxlist seglist anglist (- 1) w2lst))
(setq seg1list (intlst seg1list))
(setq seg2list (intlst seg2list))
(entmakepolyline seg1list)
(entmakepolyline seg2list)
(Geom-Entmakepolyline seg1list 0)
(Geom-Entmakepolyline seg2list 0)
)

;;;getpointlist
Expand Down Expand Up @@ -129,19 +129,6 @@
)
)

;; function of entmake lwpolyline
(defun entmakepolyline (lst)
(entmakex
(append
(list '(0 . "LWPOLYLINE")
(cons 90 (length lst))
'(70 . 0) ;;;1 is closed
) ;_ list
(mapcar '(lambda (x) (cons 10 x)) lst)
) ;_ append
)
)

;;;;make width list
;;w1: 墙点1宽度
;;w2: 墙点2宽度
Expand Down

0 comments on commit a1e1e48

Please sign in to comment.