"Project failed to load" with simple code

Started by NVIT, July 09, 2019, 05:14:30 PM

Previous topic - Next topic

NVIT

Using AutoCAD 2016

---------------------------
AutoCAD Message
---------------------------
Project failed to load!
The file could not be found or an error occurred while reading the file.

[HelloWorld]
---------------------------
OK   
---------------------------

---------------------------
OpenDCL Runtime Error
---------------------------
An OpenDCL function argument processing exception has occurred!

Error: NIL value not allowed
Function: dcl_Form_Show
Argument: 0
---------------------------
OK   
---------------------------

Error: ADS request error

-------------------------------------------------------------------------------
At the first OpenDCL arx load in AutoCAD 2016, I got the LSP security dialog. So, I picked "Always load"

(findfile"OpenDCL.20.arx")
"C:\\program files (x86)\\common files\\opendcl\\OpenDCL.20.arx"

Command: (command "OPENDCL")
OpenDCL Runtime [9.0.3.0] loaded

-------------------------------------------------------------------------------
At first, I installed v9.3. So I uninstalled it then installed the stable v8.2

The .odcl form file is in the same folder as the .lsp file.

Here's my .lsp code...

; Ensure the appropriate OpenDCL ARX file is loaded
(command "OPENDCL")

(defun c:HelloWorld ()
   ; call the method to load the HelloWorld.odcl file.
   (dcl_Project_Load "HelloWorld" T)
   ; call the method to show the Hello World dialog box example
   (dcl_Form_Show HelloWorld_Form1)
   (princ)
)
(defun c:HelloWorld/Form1#OnInitialize (/)
  (dcl-Control-SetCaption HelloWorld/Form1/Label1 "Hello World")
)


NVIT

Solved.

Moving the .odcl form file to one of AutoCAD's search paths fixed it.