2010-02-26 08:31 UTC
I saw in a post that vlax-ldata-xxx functions doesn't work with OpenDCl and it's right. But there is a method to save data with vlax-ldata-xxx when you work with OpenDCL. Lets say that we already selected an object in Autocad an appeared the OpenDCL dialog and we introduced 3 data to save to the selected object. Lets say that the dialog has a "Save" button and when we click on it the 3 entered data will be saved with vlax-ldata-put function to the selected object. Here is the code:
(defun savedata()
(vlax-ldata-put selected_object ("MyKey1" "EnteredData1"))
(vlax-ldata-put selected_object ("MyKey2" "EnteredData2"))
(vlax-ldata-put selected_object ("MyKey3" "EnteredData3"))
)
(defun c:test_Form1_Save_OnClicked ()
(dcl_Control_SetKeepFocus test_Form1 NIL) ;;Set the dialog focus ot nil
(dcl_Control_SetEventInvoke test_Form1 1) ;;Enables the command line, so u can enter commands now
(dcl_SendString "(savedata) ") ;;This is how you start the (savedata) function throgh the command line
(dcl_Control_SetKeepFocus test_Form1 T) ;;Set back the focus of the dialog
(dcl_Control_SetEventInvoke test_Form1 0) ;;Disables the command line, now u can't call functions or commands through the command line
)
I hate EED (Extended Entity Data) >:( . The vlax-ldata-xxx more easier to use and you can save unlimited data with it ;) .
-LONG LIVE THE VLAX-LDATA-XXX-
I hope i could help for some people who work with vlax-ldata-xxx function and didn't knew this little trick. :)
Best regards.
(defun savedata()
(vlax-ldata-put selected_object ("MyKey1" "EnteredData1"))
(vlax-ldata-put selected_object ("MyKey2" "EnteredData2"))
(vlax-ldata-put selected_object ("MyKey3" "EnteredData3"))
)
(defun c:test_Form1_Save_OnClicked ()
(dcl_Control_SetKeepFocus test_Form1 NIL) ;;Set the dialog focus ot nil
(dcl_Control_SetEventInvoke test_Form1 1) ;;Enables the command line, so u can enter commands now
(dcl_SendString "(savedata) ") ;;This is how you start the (savedata) function throgh the command line
(dcl_Control_SetKeepFocus test_Form1 T) ;;Set back the focus of the dialog
(dcl_Control_SetEventInvoke test_Form1 0) ;;Disables the command line, now u can't call functions or commands through the command line
)
I hate EED (Extended Entity Data) >:( . The vlax-ldata-xxx more easier to use and you can save unlimited data with it ;) .
-LONG LIVE THE VLAX-LDATA-XXX-
I hope i could help for some people who work with vlax-ldata-xxx function and didn't knew this little trick. :)
Best regards.