OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: garcigj on October 08, 2008, 04:12:26 AM

Title: Palette Form event OnClose problem
Post by: garcigj on October 08, 2008, 04:12:26 AM
No data are saved to dictionaries with vlax-ldata-xxx onclose during the event at kind FORM PALETTE. Perhaps this document readOnly during the event ...?

OpenDcl Version: 5.0.0.25
Form: Palette
Event Invoke Form: 0 - Keep Focus OR 1 -Allow (Command)
Autocad versión: 2008

(defun c:EspaciosTiempos_EP-FechasPKs_OnClose ( / TabAct)
  (Setq TabAct (dcl_Tab_GetCurSel (vl-doc-ref 'EspaciosTiempos_EP-FechasPKs_TabControl1)))
  (ET-SaveValTabs TabAct)
  (Vlax-ldata-put "ET_FECHAS&PKS" "TabActive" TabAct)
  (dcl_MessageBox (strcat "OnClose event does not save data dictionary vlax-ldata-xxx \n\n"))
  (princ)
)

After Collapse:

(Vlax-ldata-get "ET_FECHAS&PKS" "TabActive") == NIL
Title: Re: Palette Form event OnClose problem
Post by: Fred Tomke on October 08, 2008, 05:26:39 AM
Hello garcigj

1.

Don't use Ldata. Ldata may destroy your drawing. Some developers got many problems cause they have used LDATA.
See here: http://ww3.cad.de/foren/ubb/Forum145/HTML/001629.shtml#000005
. If you want to have secure access to the data use real dictionaries for huge data structures or EED for short data (for instance keys).

2.

When we have used LDATA a long time ago, we've found out that LDATA could not be written until the drawing was saved the first time.

3.

Try to write EED's instead of LData. Maybe that will work.

Fred
Title: Re: Palette Form event OnClose problem
Post by: BazzaCAD on October 08, 2008, 11:59:19 AM
Great looking form garcigj.
Do you think you can post a still screen shot of it here:
http://www.opendcl.com/forum/index.php?topic=416.0 (http://www.opendcl.com/forum/index.php?topic=416.0)

So I can show it at AU.