Author Topic: is DVB loaded  (Read 2100 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
is DVB loaded
« on: March 05, 2007, 01:35:01 PM »
I have looked for this here at the swamp, and I can't find an example that tells me a better way to do this, so I am asking the LISP Guru's What is the best way to see if a DVB is loaded?

Code: [Select]
(defun c:fixc ()
  (vl-vbarun
    "C:/Program Files/AutoCAD 2007/TEP SUPPORT/utility.dvb!FixConnection"
  )
  (setvar "filedia" 1)
  (setvar "cmddia" 1)
)

I know there is a way to use NOT function to check to see if dvb is loaded, I just cant find it.
« Last Edit: March 05, 2007, 02:51:36 PM by CmdrDuh »
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

ronjonp

  • Needs a day job
  • Posts: 7529
Re: is DVB loaded
« Reply #1 on: March 05, 2007, 02:22:46 PM »
I use this to load VBA....

Code: [Select]
(defun loadvba (/)
  (vl-catch-all-error-p
    (vl-catch-all-apply
      'vla-loaddvb
      (list (vlax-get-acad-object) "mycoolfunction.dvb")
    )
  )
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: is DVB loaded
« Reply #2 on: March 05, 2007, 02:38:58 PM »
Ok .. do you want to know how to tell if a LISP is not loaded or how a DVB is not loaded?..

If you want to know if a lisp is not loaded ....

Code: [Select]
;;;RETURNS NIL IF NOT LOADED
(not (= C:MyLisp nil))

Now to determine if a VBA file is loaded, search the PLIST value returned  ...

Code: [Select]
(defun vbprojects ()
  (setq *projects* (vlax-get-property (vlax-get-property (vlax-get-acad-object) 'vbe) 'vbprojects))
  (setq count (vlax-get-property *projects* 'count)
plist '()
  ) ;_ end of setq
  (while (/= 0 count)
    (vl-catch-all-error-p
      (setq curproj
    (vl-catch-all-apply
      'vlax-invoke-method
      (list *projects* 'item count)
    ) ;_ end of vl-catch-all-apply
      ) ;_ end of setq
    ) ;_ end of vl-catch-all-error-p
    (if (not
 (vl-catch-all-error-p
   (setq prname
  (vl-catch-all-apply
    vlax-get-property
    (list curproj 'filename)
  ) ; end vl-catch-all-apply
   ) ; end setq
 ) ;
) ;_ end of not
      (setq plist (append plist (list prname)))
      (princ prname)
    ) ;_ end of if
    (setq count (1- count))
  ) ;_ end of while
 plist
) ;_ end of DEFUN


Incidently the VBA code may not work in A2k ..
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: is DVB loaded
« Reply #3 on: March 05, 2007, 02:51:17 PM »
Good catch Keith, I meant DVB file.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)