-
Notifications
You must be signed in to change notification settings - Fork 0
/
Olifant.lsp
50 lines (48 loc) · 1.71 KB
/
Olifant.lsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(defun c:oli() ; / selall ss cn ent oldx oldy)
(command "UCS" "w")
(setq selall (ssget))
(setq ss (ssget "P" (list
(cons -4 "<OR")
(cons 0 "LINE")
(cons 0 "LWPOLYLINE")
(cons 0 "INSERT")
(cons 0 "TEXT")
(cons 0 "CIRCLE")
(cons 0 "HATCH")
(cons -4 "OR>")
)))
(setq cn 0)
(repeat (sslength ss)
(setq ent (entget (ssname ss cn)))
(cond
((= (cdr (assoc 0 ent)) "LINE")
(setq oldx (cadr (assoc 10 ent)))
(setq oldy (caddr (assoc 10 ent)))
(setq ent (subst (cons 10 (list oldx oldy 0.0)) (assoc 10 ent)
ent)) (setq oldx (cadr (assoc 11 ent))) (setq oldy (caddr
(assoc 11 ent))) (setq ent (subst (cons 11 (list oldx oldy
0.0)) (assoc 11 ent) ent))
(entmod ent)(entupd (cdr (assoc -1 ent)))
)
((= (cdr (assoc 0 ent)) "LWPOLYLINE")
(setq ent (subst (cons 38 0.0) (assoc 38 ent) ent))
(entmod ent)(entupd (cdr (assoc -1 ent)))
)
((or (= (cdr (assoc 0 ent)) "TEXT")
(= (cdr (assoc 0 ent)) "CIRCLE")
(= (cdr (assoc 0 ent)) "HATCH")
(= (cdr (assoc 0 ent)) "INSERT")
)
(setq oldx (cadr (assoc 10 ent)))
(setq oldy (caddr (assoc 10 ent)))
(setq ent (subst (cons 10 (list oldx oldy 0.0)) (assoc 10 ent)
ent)) (entmod ent)(entupd (cdr (assoc -1 ent)))
)
)
;de twee regels hieronder zijn de tilt verwijder regels
(setq ent (subst (cons 210 (list 0 0 1)) (assoc 210 ent) ent))
(entmod ent)(entupd (cdr (assoc -1 ent))) (princ ".")
(setq cn (1+ cn))
)
(command "UCS" "p")
)