after OnEnteringNoDocState

Started by velasquez · 2014-11-12 22:34 UTC · 4 replies · SMF topic #2195

Hello,
I created a variable when the last drawing was closed with OnEnteringNoDocState.
When a new design is created an error happens when I work with this variable.
The file "OpenDCL arx ....." has not yet been reloaded.
error: no function definition: dcl_Form_Show

How to check the load arx file to move forward?

I'm working with the code below.
;;;the last drawing was closed
(defun c:dc_MainMenu_cBarMax_OnEnteringNoDocState (/)
  (vl-bb-set 'JoyFormName 'dc_MainMenu_cBarMax)
  (dcl_Form_Close dc_MainMenu_cBarMax)
)

;;;new design is created
(if (vl-bb-ref 'JoyFormName)
  (progn
  (dcl_Form_Show (eval (vl-bb-ref 'JoyFormName)))
    (vl-bb-set 'JoyFormName NIL)
  ) ;_ fim de progn
) ;_ fim de if
What do you mean by "new design"? What steps are you performing, and in what context is that code executing?
author=owenwengerd link=topic=2195.msg11009#msg11009 date=1415852342 wrote:
What do you mean by "new design"? What steps are you performing, and in what context is that code executing?


I meant opening a new drawing.

1 - Open a new drawing.
2 - Call dcl_Form_Show with variable saved in OnEnteringNoDocState.
3 - Working with OnInitialize and ... TabStrip_OnSelChanging.
Do I understand correctly that you call (dcl-Form-Show) from OnInitialize and OnSelChanging? From a different form, I guess? How are those events being triggered?
author=owenwengerd link=topic=2195.msg11012#msg11012 date=1415892669 wrote:
Do I understand correctly that you call (dcl-Form-Show) from OnInitialize and OnSelChanging? From a different form, I guess? How are those events being triggered?

Hi Owen,
With my English is very difficult to explain to you
But I managed to solve my problem working with (vl-load-all my_function) in Visual Lisp.

"vl-load-all -> Loads a file into all open AutoCAD documents, and into any document subsequently opened during the current AutoCAD session"

Thanks for your help