-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodbx_getpolinlay.lsp
More file actions
70 lines (60 loc) · 2.14 KB
/
odbx_getpolinlay.lsp
File metadata and controls
70 lines (60 loc) · 2.14 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
; ANSI-Windows 1252
; Autolisp, Visual Lisp
;|
odbx_getpolinlay.lsp 1.0
Copy all Polylines in a layer, and paste in current dwg.
Place the files, odbx_getpolinlay.lsp and odbx_fct.lsp, in an Autocad approved folder.
Use APPLOAD to load them.
Enter odbx_getpolinlay in Autocad, enter the layer name and choose folder.
Drawings are not open.
Tested on Windows 10 and Autocad 2015.
No copyright: (!) 2021 by Fr�d�ric Coulon.
No license: Do with it what you want.
|;
;Dependencies
(vl-load-com)
;(load "fct.lsp")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:odbx_getpolinlay (/ axdoc acobj lfil dir objlst model lay)
(setq acobj (vlax-get-acad-object)
model (vla-get-modelspace (vla-get-activedocument acobj))
lay (getstring "What layer?")
)
; Choose folder.
(if (and (setq dir (getdir))
; dwg liste.
(setq lfil (vl-directory-files dir "*.dwg" 1)))
; Loop over files.
(progn
(foreach f lfil
(if (setq axdoc (getaxdbdoc (strcat dir f)))
(progn
(setq objlst '())
; Sorting objects.
(vlax-for obj (vla-get-modelspace axdoc)
(and (= (vla-get-ObjectName obj) "AcDbPolyline")
(= (vla-get-layer obj) lay)
(setq objlst (cons obj objlst))
)
)
(if objlst
(progn
; Copy the objects in the current drawing.
(vla-copyobjects axdoc (vlax-safearray-fill
(vlax-make-safearray vlax-vbobject(cons 0 (1- (length objlst))))
objlst)
model)
(vlax-release-object axdoc)
)
)
)
(princ (strcat "\n" f ": Illegible or corrupt."))
)
)
(vla-zoomextents acobj)
)
(princ "\nHave you lost your way?")
)
(princ)
)
;�;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;