Bricscad V18 and ONDOCACTIVATED and NODOCSTATE

Started by Peter2, January 08, 2018, 04:08:54 AM

Previous topic - Next topic

Peter2

ODCL 8.2.1.2, Bricscad V18.1.08

I had some strange issue with ONDOCACTIVATED and NODOCSTATE, something like this:
---------- [ BricsCAD - Mon Jan 08 13:37:55 2018] ----------
: _qnew
:
; ----- Error around expression -----
(C:SIA_BAUM/STRUKTUR#ONDOCACTIVATED)
;
; error : no function definition <C:SIA_BAUM/STRUKTUR#ONDOCACTIVATED> ; expected FUNCTION at [eval]
: _WCLOSE
:
; ----- Error around expression -----
(C:SIA_BAUM/STRUKTUR#ONDOCACTIVATED)
;
; error : no function definition <C:SIA_BAUM/STRUKTUR#ONDOCACTIVATED> ; expected FUNCTION at [eval]
:
Abbrechen
:
:
:
: _WCLOSE
; ----- Error around expression -----
(PRINC)
;
; error : bad argument type <#<<FUNCTION> #x3b @1000448976>> ; expected <FUNCTION> at [funcall]
;
; error : during LISP function [c:sia_baum/struktur#OnEnteringNoDocState] invoke from BRX/SDS interface,
          please check Lisp function definition and call arguments.



Maybe I made a bad code, so I tested with "OpenDCLDEMO" - start a drawing, close a drawing, create new drawing, and got this:


---------- [ BricsCAD - Mon Jan 08 13:59:16 2018] ----------
: _qnew
; ----- Error around expression -----
(DEFUN DCL_CONTROL_SETTIMER REST (AL_LEAVEDEFUN (AL_ENTERDEFUN 'DCL_CONTROL_SETTIMER NIL) (AL_EXECUTEADSDEFUN "DCL_CONTROL_SETTIMER" REST)))
;
; error : bad argument type <#<<FUNCTION> #x3b @100025c6b6>> ; expected <FUNCTION> at [funcall]

;
; error : during LISP function [c:AllSamples/Main#OnSize] invoke from BRX/SDS interface,
          please check Lisp function definition and call arguments.

; ----- Error around expression -----
(DEFUN DCL_CONTROL_SETTIMER REST (AL_LEAVEDEFUN (AL_ENTERDEFUN 'DCL_CONTROL_SETTIMER NIL) (AL_EXECUTEADSDEFUN DCL_CONTROL_SETTIMER REST)))
;
; error : bad argument type <#<<FUNCTION> #x3b @100025c6b6>> ; expected <FUNCTION> at [funcall]

;
; error : during LISP function [c:AllSamples/Main#OnSize] invoke from BRX/SDS interface,
          please check Lisp function definition and call arguments.
:
; ----- Error around expression -----
(C:ALLSAMPLES/MAIN#ONDOCACTIVATED)
;
; error : no function definition <C:ALLSAMPLES/MAIN#ONDOCACTIVATED> ; expected FUNCTION at [eval]
:


Can someone confirm or explain or solve it?
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

roy_043

Your ODCL is calling functions that do not exist in the newly opened document.

To avoid this you can do three things:
1.
Make sure to autoload your code in every drawing.
2.
Changing the LISPINIT setting may work?
3.
Disable the dialog before the new document becomes active.
And when (and if) your application code loads in the new drawing re-activate it.
In my BKG_Browser application I am using two reactors to achieve this:
A vlr-docmanager-reactor reactor (:vlr-documentbecamecurrent and :vlr-documenttobedeactivated).
And a vlr-command-reactor reactor (:vlr-commandcancelled, :vlr-commandfailed and :vlr-commandwillstart).
The command reactor is required for the "OPEN" and "QNEW" commands in which cases the docmanager reactor events do not fire.

Peter2

Thanks roy_043
I thought that the events would handle this by themselves ...
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10