Recent Posts

Pages: [1] 2 3 ... 10
1
Runtime/AutoLISP / Re: "Project failed to load" with simple code
« Last post by NVIT on July 09, 2019, 05:36:43 PM »
Solved.

Moving the .odcl form file to one of AutoCAD's search paths fixed it.
2
Runtime/AutoLISP / "Project failed to load" with simple code
« Last post by NVIT on July 09, 2019, 05:14:30 PM »
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")
)

3
Runtime/AutoLISP / Re: Dialog events fire when other code is running
« Last post by honkinberry on July 02, 2019, 08:37:05 AM »
Some further information, it appears some of the cases are from users mistakenly double-clicking, or hastily re-clicking, buttons.
So in which case, it seems the simplest solution, is for any of these instances, to add something like this:

Code: [Select]
; global
(setq _ODCLEVENT nil)

; button handler
(defun c:dclButtonClicked ()
    (if (not _ODCLEVENT)
        (if (and (setq _ODCLEVENT t)
                (GoEventHandler)
            ) ; and
            (setq _ODCLEVENT nil)
        ) ; if
    ) ; if
) ; ButtonClicked

Simple and effective, yes?

--J
4
Runtime/AutoLISP / Re: Dialog events fire when other code is running
« Last post by owenwengerd on June 27, 2019, 01:54:02 PM »
Dialog events are just windows messages, and those continue to get processed (at certain points) even while lisp is running. In a case like you describe, I would disable the dialog until the operation completes.
5
Studio/Dialog Editor / Re: Unexpected OpenCDL close
« Last post by owenwengerd on June 27, 2019, 01:51:39 PM »
Do you mean the maximized document window in OpenDCL Studio? I just tested it, and it only closed the form window as expected.
6
Studio/Dialog Editor / Unexpected OpenCDL close
« Last post by Jim Short on June 27, 2019, 06:33:47 AM »
Pressing the lower X button on maximized form window should not close OpenDCL.
7
Runtime/AutoLISP / Re: Dialog events fire when other code is running
« Last post by roy_043 on June 25, 2019, 12:43:35 AM »
IMO you should perform these lengthy operations before initialization and thereby avoid the problem altogether.
8
Runtime/AutoLISP / Dialog events fire when other code is running
« Last post by honkinberry on June 24, 2019, 02:28:31 PM »
Every day we get a number of errors from users, that appears to be due to a dialog event firing when other code is running.
The best example, is one dialog queries for additional cloud content, and so internet issues can cause it to take several seconds to complete.  So a hasty user clicks on buttons, which then fire additional events, yet variables are in between states, and errors result.

Here's an example from today:
Code: [Select]
[0.226] (VL-BT)
[1.222] (AXIS_ERR "bad argument type: fixnump: nil")
[2.217] (_call-err-hook # "bad argument type: fixnump: nil")
[3.211] (sys-error "bad argument type: fixnump: nil")
:ERROR-BREAK.206 nil
[4.203] (ITOA nil)
[5.198] (SAVEPREFS)
[6.194] (C:DCLACCEPTCLICKED)
[7.190] (#)
:CALLBACK-ENTRY.187 (:CALLBACK-ENTRY)
[8.184] (#)
[9.181] (_lisplet-apply # # nil :CALLBACK-ENTRY)
[10.173] (_lisplet-callback-apply # "C:DCLACCEPTCLICKED" nil)
[11.166] (#)
[12.163] (ARQ-SUBR! 3022)
:ARQ-SUBR-CALLBACK.158 (nil 3022)
[13.155] (STRCASE "21` OaCv")
[14.150] (FX:PLANTSIZESORTVAL "21` OaCv")
[15.145] (# "21` OaCv" "18` ht x 10` spd")
[16.140] (VL-SORT ("16` Ht., CT" "-" "2-3` ht." "2-4` ct." "3` Height, matching" "4`-5` overall ht." "5-6` ht. x 3-4` spd." "5` ht. x 4` spr." "5` ht. x 5` spr." "5` o.a.h." "5`-6` Ht, x 2`-3` spd." "5`-6` ht. x 3` spd." "6-15` x 4` spd" "6-8` height, 4` Spread" "6` CT - Central leader, full & matched" "6` Clear Trunk" "6` c.t." "6` ht x 6` spd" "6` ht. x 2` spd." "6` ht. x 6` spd." "6`-10` CT. Stagger Hts." "6`-8` ht. x 3`-4` spd."

In that example, the dialog box initialization is firing, which involves loading a good amount of data and preparing it.
You can see it is right in the middle of sorting a very long list, when suddenly a dialog AcceptClicked fires, and global variables it relies on have not been set yet upon completion of the Initialization.

So how, can a dialog event, interrupt already executing code?!  Doesn't it have to go to the back of the stack and wait?

I hope that's clear, happy to help explain more.  If anyone has any tips it'd be much appreciated!

--J
9
Runtime/AutoLISP / Re: not show preview some block specially ac$ block
« Last post by CADwiesel on June 20, 2019, 04:05:05 AM »
The _BLOCKICON command is not available in BricsCAD. Is there an solution too?
10
Hello,
I have a program that loads and displays images from a given directory in a picture with dcl-PictureBox-LoadPictureFile. That works too.
Now I have noticed that, if the same image has already been referenced to the DWG drawing, then the image will not be displayed in the OpenDcl control image.

Is that how it is or am I doing something wrong?

Note: the dcl-PictureBox-LoadPictureFile function returns a T.

As always, I'm grateful for every tip.
many Greetings
J
Pages: [1] 2 3 ... 10