Problem with (type dcl_getversionex)

Started by Emiliano, March 21, 2015, 03:33:49 AM

Previous topic - Next topic

Emiliano

Hello everyone,
to load my project use this function:

Code (autolisp) Select

(defun LoadRunTime ( / )
    ;; Demand load the OpenDCL.##.ARX. This requires the OpenDCL Runtime or Studio to be installed on each PC first.
    (cond
      ( (= 'EXRXSUBR (type dcl_getversionex)) )
      ( (= 2 (boole 1 (getvar "DEMANDLOAD") 2))
        (vl-cmdf "_OPENDCL")
        (if (/= 'EXRXSUBR (type dcl_getversionex))
          (progn
            (princ "\nThe OpenDCL Runtime module failed to load. Please repair the OpenDCL installation and try again.")
            ;(exit)
          )
        )
      )
      ( (progn
          (princ "\nThe OpenDCL Runtime module cannot be loaded because demand loading is disabled.\nLoad the OpenDCL ARX file manually, or enable demand loading for commands by setting the DEMANDLOAD system variable to 2 or 3.\nSee the \"ManualLoading.lsp\" sample for a demonstration.")
          ;(exit)
        )
      )
    )
)



Unfortunately, on some occasions (random), the error appears "\nThe OpenDCL Runtime module failed to load. Please repair the OpenDCL installation and try again.".
This happens because (type dcl_getversionex) = SUBR instead of EXRXSUBR

Even if this error appears, the form is loaded and working properly.

You have no idea why this happens?
Any advice?

Thanks in advance

roy_043

#1
You can avoid the issue by changing Line 4 to:
Code (autolisp) Select
( dcl_getversionex )

And changing Line 7 to:
Code (autolisp) Select
(if (not dcl_getversionex)

owenwengerd

I recommend to replace all of that with simply
Code (autolisp) Select
(command "_OPENDCL")