2015-08-18 13:36 UTC
I read tutorial to create very simple form but does anyone know how can I call lisp routine within an loading odcl lisp? It makes me crazy, sometimes it working sometime not. I created very simple form and checked that and nothing is wrong. Here is my odcl lisp and my function lisp.
Function lisp:
;;;;;;;;; Part of long lisp
(defun c:DELDIM (/ ss)
(setq ss (ssget "x" (list (cons 0 "Dimension"))))
(if ss
(vl-cmdf ".erase" ss "")
(princ "\nNo dimensions in this drawing!")
)
(princ)
)
;;;;;;;;;
and here is odcl lisp:
(setq cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(command "_OPENDCL")
(setvar "CMDECHO" cmdecho)
(defun c:ddim ()
; call the method to load the deldim.odcl file.
(dcl_Project_Load "deldim" T)
(dcl_Form_Show deldim/Form1)
(princ)
)
(defun c:deldim/Form1/cmdDelDim#OnClicked (/)
(load "C:\\Lisps\\function.lsp")
(prompt "\function.lsp Loaded...")
(c:DELDIM)
(princ)
)
(defun c:deldim/Form1/cmdClose#OnClicked (/)
(dcl-Form-Close deldim/Form1)
(princ)
)
Thanks
Function lisp:
;;;;;;;;; Part of long lisp
(defun c:DELDIM (/ ss)
(setq ss (ssget "x" (list (cons 0 "Dimension"))))
(if ss
(vl-cmdf ".erase" ss "")
(princ "\nNo dimensions in this drawing!")
)
(princ)
)
;;;;;;;;;
and here is odcl lisp:
(setq cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(command "_OPENDCL")
(setvar "CMDECHO" cmdecho)
(defun c:ddim ()
; call the method to load the deldim.odcl file.
(dcl_Project_Load "deldim" T)
(dcl_Form_Show deldim/Form1)
(princ)
)
(defun c:deldim/Form1/cmdDelDim#OnClicked (/)
(load "C:\\Lisps\\function.lsp")
(prompt "\function.lsp Loaded...")
(c:DELDIM)
(princ)
)
(defun c:deldim/Form1/cmdClose#OnClicked (/)
(dcl-Form-Close deldim/Form1)
(princ)
)
Thanks