• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

file opening fails

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I'm going crazy trying to open a file. I always get the message.
> error: type of wrong topic: file nil

the name of the file, complete of the path is > d:\altprovvisori\lcfile.dat < that translated the autolisp fa > d:\\altprovvisori\\\lcfile.dat <.

if I enter the route directly:
Code:
(setq path "d:\\altprovvisori\\\\lcfile.dat")
everything works perfectly, if instead I derive the path through the clipboard of windows 10 :
Code:
 (setq path nil)
(runapp "c:\\autocadsupporto\\\\libertytre\\\inputpregeo.exe "c:\\\\\autocadsupporto\\\\\\\\inputpregeo.tkn" :vlax-true)
(while (= path nil)
(setq route (getcliptext))
);

(princ "\n")
(princ)
(princ route)
(princ "\n")
obtaining > d:\\\altprovvisori\\\\\lcfile.dat < appears the above error message and the operation fails.

I also entered the apics before and after > "d:\\\altprovvisori\\lcfile.dat" but the result is the same.
Thank you.
 
Sorry, but where do you open the file?
is runapp the opening call? I didn't find her in the lisp functions
 
thanks crystal I omitted the opening of the file:
Code:
(setq path nil)

(runapp "c:\\autocadsupporto\\\\libertytre\\\inputpregeo.exe "c:\\\\\autocadsupporto\\\\\\\\inputpregeo.tkn" :vlax-true)

(while (= path nil)
(setq route (getcliptext))
);

(princ "\n")
(princ)
(princ route)
(princ "\n")

(setq frd)
The results are these:

path > > > > d:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
point of origin : error: type of wrong subject: file nil
Thank you.
 
I believe you are reporting that the file variable contains a type of data not consistent with the one required by the command, or that it is nil (non-existent)
 
These are the results obtained with the different options:
option 1 - inserting the file name to open (path) directly from the command bar
Code:
command: lcdraw

(setq filename)

complete path: d:\altprovvisori\lcfile.dat

filename >> > d:\altprovvisori\lcfile.dat

d:\altprovvisori\lcfile.dat

.... .
...... It works!!!!!! ! !
option 2 - insertion via external program - not apici - simple overturn bar
Code:
command: lcdraw

(runapp "c:\\autocadsupporto\\\\libertytre\\\inputpregeo.exe "c:\\\\\autocadsupporto\\\\\\\\inputpregeo.tkn" :vlax-true)
(setq filename (getcliptext))

filename >> > d:\altprovvisori\lcfile.dat

d:\altprovvisori\lcfile.dat

; error: type of wrong subject: file
I
option 3 - insertion via external program - non apici - double overturn bar
Code:
command: lcdraw

(runapp "c:\\autocadsupporto\\\\libertytre\\\inputpregeo.exe "c:\\\\\autocadsupporto\\\\\\\\inputpregeo.tkn" :vlax-true)
(setq filename (getcliptext))

filename > > > d:\\\altprovvisori\\\lcfile.dat

d:\\altprovvisori\\\lcfile.dat

; error: type of wrong subject: file nil
option 4 - insertion via external program - with apici - double reverse bar
Code:
command: lcdraw

(runapp "c:\\autocadsupporto\\\\libertytre\\\inputpregeo.exe "c:\\\\\autocadsupporto\\\\\\\\inputpregeo.tkn" :vlax-true)
(setq filename (getcliptext))

filename > > > d:\\\altprovvisori\\\lcfile.dat"

"d:\\altprovvisori\\\lcfile.dat"

; error: type of wrong subject: file nil
option 5 - insertion via external program - with apici - simple overturn bar
Code:
command: lcdraw

filename > > > d:\altprovvisori\lcfile.dat"

"d:\altprovvisori\lcfile.dat"

; error: type of wrong subject: file nil
I don't know what to invent anymore! ! !
Thank you.
 
I believe that the difficulty is in the "nature" of what lcdraw produces.
Is that a pure string?
the getcliptext function is not autolisp. Did you make it? What does it return?
 
I follow the story:
the application > inputpregeo.exe < transfer in the Windows 10 clipboard the name of the file to be opened complete of the path.

the function > (getcliptext) < returns the contents of the windows notes then the name of the file to be opened complete with the path.
Code:
 (defun getcliptext(/ html result)
(setq html (vlax-create object "htmlfile"))
(setq result (vlax-invoke (vlax-get (vlax-get html 'parentwindow) 'clipboarddata) 'getdata 'text'))
(vlax release object html)
result
);
I do not understand why if I insert the file name from the autocad command bar:
Code:
(setq filename)
everything works perfectly with the string > d:/altprovvisori/lcfile.dat <.

If I extract the same string from windows 10 notes, it does not work.
Code:
 (runapp "c:\\autocadsupporto\\\\libertytre\\\inputpregeo.exe "c:\\\\\autocadsupporto\\\\\\\\inputpregeo.tkn" :vlax-true)
(setq filename (getcliptext))
result :
and yet it is the same thing, the same stringa|
Thank you.
 
try to process the autolisp string.
a useless thing, of the type (setq stringa2 (strcat filename ""))
see if she treats her like a string
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top