-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCHECK_RESOURCE.LSP
executable file
·62 lines (41 loc) · 2.03 KB
/
CHECK_RESOURCE.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
;;;;;;;[ Resource Check ];;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Checks for various resources needed for ;;
;; the main plan drawing function. ;;
;; ;;
;;::::::::::::::::::::::::::::::::::::::::::::::;;
;; ;;
;; Author: J.D. Sandifer (Copyright 2015) ;;
;; Written: 12/09/2015 ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; 12/09/2015 ;;
;; - Began initial code writing (MLSTYLE). ;;
;; Success! ;;
;; ;;
;; 12/14/2015 ;;
;; - Began initial code writing (block). ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:resourcecheck ( / mlstyleToCheck mlstyleDictionary topRailMLStyle)
(setvar "cmdecho" 0) ; Turn off command line output
(setq blockToCheck "END_PLATE")
(setq mlstyleToCheck "TOP_RAIL")
;; Search fo block needed in the block table
(setq blocktable tablesearch)
(setq block (dictsearch blocktable blockToCheck))
;; Display result of search
;; Search for MLSTYLE needed in the style dictionary.
(setq mlstyleDictionary (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))
(setq topRailMLStyle (dictsearch (cdr (assoc -1 mlstyleDictionary)) mlstyleToCheck))
;; Display result of search
(cond ((/= topRailMLStyle nil)
(princ (strcat "\nMLStyle \"" mlstyleToCheck "\" found!\n"))
(princ topRailMLStyle))
((= topRailMLStyle nil)
(princ (strcat"\nMLStyle \"" mlstyleToCheck "\" not found.\n"))
(princ "Cannot complete function: Exiting...")))
(setvar "cmdecho" 1) ; Command line back on
(princ)) ; Clean exit (hide last return value)
(princ) ; Clean load (no output)