-
Notifications
You must be signed in to change notification settings - Fork 3
/
include.lsp
68 lines (66 loc) · 3.29 KB
/
include.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
;;;=====================================================================
;;; Please register this file at the top of youe project files in
;;; Visual LISP, when you make Separate-namespace VLX Application.
;;; If you are using Visual Studio Code with AutoCAD 2021 or later,
;;; make sure it loads before your project's files.
;;; The functions described in this file are a companion to the
;;; functions described in include-lib.LSP and will only work if loaded
;;; in Separate-namespace.
;;; Please see also include-lib.LSP
;;;=====================================================================
;;; (include 'function filename)
;;;---------------------------------------------------------------------
;;; function : symbol
;;; filename : string
;;;---------------------------------------------------------------------
;;; If no function is defined, the file will be loaded in Separate-
;;; namespace VLX Application.
;;;=====================================================================
;;; NOTE
;;; In its Separate-namespace, the load-file and resource-file
;;; functions will have no effect.
;;;=====================================================================
;;; +------------------------------------------------------------------+
;;; Copyright (c) 2020 manual chair japan
;;; Released under the MIT license
;;; https://opensource.org/licenses/mit-license.php
;;; +------------------------------------------------------------------+
(if (null *DrawingLevelEnviromet*)
(setq *include:stack* nil
include (lambda ($_include:symbol $_include:resource /
$_filename-base
)
(if
(and (not (boundp $_include:symbol))
(null
(member
(setq $_filename-base (vl-filename-base
$_include:resource
)
)
*include:stack*
)
)
)
(progn
(setq *include:stack* (cons $_filename-base
*include:stack*
)
)
(load $_filename-base
'(princ
(strcat
"\n; Resource Load Error : "
$_filename-base
)
)
)
(setq *include:stack* (cdr *include:stack*))
$_include:symbol
)
)
)
load-file (lambda (filename) nil)
resource-file (lambda (filename) nil)
)
)