|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
#1
|
|||
|
|||
Error in lisp: the stream is already close??
Hi to all.
I' ve thi code LISP but second load (using defun insertdev) put this error : Errore LISP: The stream #<input stream "c:/eurocad/virtualcomponent/tmp/FileGeometry2loadModeling.lsp"> is already closed. Code: Code:
(in-package :ttscad) (use-package :oli) (sd-defdialog 'GetInsertPointDlg :dialog-title "Selezione inserimento" :prompt-text "Selezione inserimento" :variables '( ; indicato che seleziono solo punto (select_3d_point :value-type :point-3d :title "Seleziona il punto" :prompt-text "Seleziona il punto" ;:next-variable 'select_3d_point :after-input (3d_point_selected) );;select_3d_point ) :local-functions '( (3d_point_selected() (setf localwerte (oli::sd-vec-xform select_3d_point :source-space :global :dest-space :global)) (defparameter *posX* (oli::gpnt3d_x localwerte) 0) (defparameter *posY* (oli::gpnt3d_y localwerte) 0) (defparameter *posZ* (oli::gpnt3d_z localwerte) 0) (defparameter *dir1X* 1 1) (defparameter *dir1Y* 0 0) (defparameter *dir1Z* 0 0) (defparameter *dir2X* 0 0) (defparameter *dir2Y* 1 1) (defparameter *dir2Z* 0 0) );;3d_point_selected ) :cancel-action '(cancelcall) :ok-action '(progn (defparameter *Owner* "/") (okcall) ) :toolbox-button nil ) (defun insertdev(szfile2load) (oli::sd-call-dialog GetInsertPointDlg) 'get poin (load szfile2load) 'load file lsp ;(post-load-reposition) ) (defun test() (insertdev "c:/eurocad/virtualcomponent/tmp/FileGeometry2loadModeling.lsp") (insertdev "c:/eurocad/virtualcomponent/tmp/FileGeometry2loadModeling_1.lsp") ) Thanks! Device |
#2
|
||||
|
||||
Re: Error in lisp: the stream is already close??
Can you post the code for FileGeometry2loadModeling.lsp and FileGeometry2loadModeling_1.lsp?
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ |
#3
|
|||
|
|||
Re: Error in lisp: the stream is already close??
Hi.
I attach file .lsp, FileGeometry2loadModeling.lsp; FileGeometry2loadModeling_1.lsp is the same with different name. Thanks |
#4
|
||||
|
||||
Re: Error in lisp: the stream is already close??
What happens if you load empty files instead of FileGeometry2loadModeling*.lsp?
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ |
#5
|
|||
|
|||
Re: Error in lisp: the stream is already close??
Same message, the files are empty!!!
I attach file .lsp with test code. Thanks Device |
#6
|
||||
|
||||
Re: Error in lisp: the stream is already close??
Question for clarification: In the latest test.lsp file, we find:
Code:
(defun test() (insertdev "C:\\eurocad\\VirtualComponent\\tmp\\FileGeometry2loadModeling.lsp" ) (insertdev "C:\\eurocad\\VirtualComponent\\tmp\\FileGeometry2loadModeling_1.lsp" ) ) What happens if you comment out "(oli::sd-call-dialog GetInsertPointDlg)"?
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ |
#7
|
|||
|
|||
Re: Error in lisp: the stream is already close??
<So even if the referenced files are empty, you still get the error if you run test.lsp. Correct?>
Yes, correct! <If so, I assume that in order to see the error, you have to load test.lsp, then execute (test). Correct again?> I execute (ttscadenas1::ritest).....so correct!! <What happens if you comment out "(oli::sd-call-dialog GetInsertPointDlg)"?> No errors appears!! Why GetInsertPointDlg do this error? Some end of statement is missing? Thanks! Devi |
#8
|
||||
|
||||
Re: Error in lisp: the stream is already close??
What happens if you quote the GetInsertPointDlg symbol, for example like this:
(oli:sd-call-dialog 'GetInsertPointDlg) OR (oli:sd-call-dialog "GetInsertPointDlg")
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ |
#9
|
|||
|
|||
Re: Error in lisp: the stream is already close??
Thanks clausb but in this mode (oli::sd-call-dialog "GetInsertPointDlg") happens this:
load ths .lsp file and view dialog.....not sequency!!! The sequence must be: --> GetInsertPointDlg (request first point) mutual --> load first .lsp --> GetInsertPointDlg (request second point) mutual --> load second .lsp Thanks! Devi |
#10
|
||||
|
||||
Re: Error in lisp: the stream is already close??
My proposal would be to get the two points *inside* GetInsertPointDlg, i.e. prompt the user for two points inside the same dialog, instead of calling the dialog twice.
Calling the dialog as (do-whatever GetInsertPointDlg) does not do what you probably thought it does. The reason is that dialog symbols are evaluated in a very special fashion. My blog series "And... Action!" has some background on this: http://www.clausbrod.de/Blog/DefinePrivatePublic20090831AndAction http://www.clausbrod.de/Blog/DefinePrivatePublic20090908AndActionPart2 http://www.clausbrod.de/Blog/DefinePrivatePublic20090919AndActionPart3
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ |
#11
|
|||
|
|||
Re: Error in lisp: the stream is already close??
I think I understand .... I'll try. thanks Clausb!!!
Device |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|