Author Topic: VL-VLX-LOADED-P syntax..  (Read 2708 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
VL-VLX-LOADED-P syntax..
« on: November 16, 2006, 02:39:30 PM »
Code: [Select]
(IF (not (vl-vlx-loaded-p "test1"))
(load "x:/Acad/test1.vlx"))


why this code is not working ?

Code: [Select]
(load "x:/Acad/test1.vlx") ;; return NIL
(vl-vlx-loaded-p "test1") ;; return NIL
Keep smile...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: VL-VLX-LOADED-P syntax..
« Reply #1 on: November 16, 2006, 02:49:07 PM »
I don't use 'vlx' programs, so I'm not the best to answer, but this from the help might be the reason.
Quote
If the application was not defined to run in its own namespace,
it would load into the current document’s namespace and
vl-vlx-loaded-p would return nil.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

LE

  • Guest
Re: VL-VLX-LOADED-P syntax..
« Reply #2 on: November 16, 2006, 03:13:06 PM »
This is the way:

Code: [Select]
(if (and (findfile "arcdraw.vlx")
(not (vl-vlx-loaded-p "arcdraw")))
  (load (findfile "arcdraw.vlx") nil))

hth

Andrea

  • Water Moccasin
  • Posts: 2372
Re: VL-VLX-LOADED-P syntax..
« Reply #3 on: November 16, 2006, 03:20:51 PM »
hmm...
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Re: VL-VLX-LOADED-P syntax..
« Reply #4 on: November 16, 2006, 03:22:57 PM »
This is the way:

Code: [Select]
(if (and (findfile "arcdraw.vlx")
(not (vl-vlx-loaded-p "arcdraw")))
  (load (findfile "arcdraw.vlx") nil))

hth

Thanks LE....


but after runnig your code....
try this...

Code: [Select]
(vl-vlx-loaded-p "arcdraw")

It return NIL.
Keep smile...

LE

  • Guest
Re: VL-VLX-LOADED-P syntax..
« Reply #5 on: November 16, 2006, 03:29:02 PM »
 :-)

Vous devez remplacer le nom de l'application, au match vôtre.

Dovete sostituire il nome dell'applicazione, con il fiammifero il vostro.

The code was an example of one of my routines.

HTH

LE

  • Guest
Re: VL-VLX-LOADED-P syntax..
« Reply #6 on: November 16, 2006, 03:40:55 PM »
Remember that if you use that function it will only work if the VLX was made as a protected namespace... if not will always return NIL.

HTH
« Last Edit: November 16, 2006, 03:48:56 PM by LE »

Patrick_35

  • Guest
Re: VL-VLX-LOADED-P syntax..
« Reply #7 on: November 16, 2006, 03:44:19 PM »
You want to say if the application is loaded ?
an example with layer manager
Code: [Select]
(if c:lman
  (alert "Layer manager is loaded")
  (alert "Layer manager don't loaded")
)

@+

Andrea

  • Water Moccasin
  • Posts: 2372
Re: VL-VLX-LOADED-P syntax..
« Reply #8 on: November 16, 2006, 04:04:01 PM »
ok...

I don't want to know if a function is available..
I need to know if a VLX is loaded..

(if (null c:function1) (load "lisp1.lsp"))

In the lisp1.lsp ,you can have

Code: [Select]
(defun c:function1 ()
(alert "function1 loaded"))

I would like to have something like..
Code: [Select]
(if (not (member "acapp.arx" (arx)))
(alert "ACADPP.ARX is not loaded"))

(arx) = all arx filed loaded right ?
but there is no (LSP) or (VLX)...

The (vl-vlx-loaded-p "arcdraw") return NIL.....eaven the file is loaded.

Note:
don't worry...i have replaced the "arcdraw" with my VLX file... :wink:


« Last Edit: November 16, 2006, 04:07:33 PM by Andrea »
Keep smile...