Is DVB Loaded--a solution, not a question

Is DVB Loaded--a solution, not a question

Anonymous
Not applicable
166 Views
0 Replies
Message 1 of 1

Is DVB Loaded--a solution, not a question

Anonymous
Not applicable
This question has been kicked around dozens of times on here, with the most
common solution using VL-VBARUN with the fully qualified path to eliminate
the annoying "already loaded" message.

However, there are times when it is useful to simply know whether or not a
project is loaded. Bernard Flavignard posted a solution a couple of years
ago, which I modified slightly. This function takes a DVB name (you don't
need to include ".dvb") and returns T or NIL depending on whether or not the
project is loaded. The argument is case insensitive.

Ben Rand
CAD Manager
CEntry Constructors & Engineers

;;;based on a program written by Bernard Flavignard
(defun IsDVBLoaded (sFileName)
(vl-load-com)
(setq vbp (vlax-get-property(vla-get-vbe (vlax-get-acad-object))
'vbprojects)
cnt (vlax-get-property vbp 'count)
ind 1
)
(if (= cnt 0)
(print "There are no DVB files currently loaded.")
)
(repeat cnt
(setq prj-name (vlax-get-property (vla-item vbp ind) 'name)
ind (1+ ind))
(setq DVBList (append (list (strcase prj-name)) DVBList))
)
(if (member (strcase sFileName) DVBList)
T
nil
);end if
);end function IsDVBLoaded
0 Likes
167 Views
0 Replies
Replies (0)