Home Tour! Products Download Purchase Support Company Contacts  

Question

I can't get a method to be activated from a VLX compile using the separate name space argument, but I can with a lsp or fas file?

Answer

What is happening is that ObjectDCL creates a global variable for each control and form, each named using the "" property, to indicate the control or form being referenced. These VarName variables are destroyed once the dialog is closed. This greatly increases the access speed by storing a unique Id in each of these variables. Since ObjectDCL creates its global variable in the document namespace, you will need to use the VL-DOC-REF function to import the value stored in the global variable. Doing this will make the program work the same as a fas or lsp file.

A simple example is shown below.

; import the ObjectARX functions into this separate name space
(vl-arx-import "objectdcl.arx")

(defun c:test10 ()
(Odcl_LoadProject "Test" T)
; in a seperate namespace it is important to use quotes not the VarName variable for any Odcl_Form_... calls.
(Odcl_Form_Show "Test" "Test")
);end defun
(defun c:test_TextButton1_OnClicked ()
(Odcl_Control_SetProperty (vl-doc-ref 'test_test_Ctrl1) "Text" "New Text goes here")
;the above line works in a vlx the same way an un-compiled lisp.
);end defun
Home Products Download Purchase Support Company Contacts