lacciap 发表于 2022-7-6 10:06:43

script problem: blank space in

Hi to everyone,
 
this is my first post on the forum and I want to thanks to all of you will have patience to read my post.
 
I have a problem with the blank space in some filepaths of my script.
something like
 
C:\Documents and settings\test.txt
 
in a script line. AutoCAD consider the first blank space like an enter and of course it doesn't know the 'AND' command.
and my script doesn't work.
 
I know the most easy answer would be 'change your path in a different one without blank spaces!' but unfortunately I can't.
 
I don't know how to solve this problem. I heard AutoLISP is a stronger tool to use for that scope but I don't know anything about LISP. So I'll appreciate all of your tips and your help.
Thanks.

Lee Mac 发表于 2022-7-6 10:10:48

You will find your answer here
 
http://lee-mac.com/scriptwriting.html
 
Welcome to CADTutor

lacciap 发表于 2022-7-6 10:13:26

Thank you very much Lee Mac!
I didn't think it could be so easy and thanks for your quick answer!

designerstuart 发表于 2022-7-6 10:17:24

for those without access to the link: just use "quotes"
 
"C:\Documents and settings\test.txt"
instead of
C:\Documents and settings\test.txt

Lee Mac 发表于 2022-7-6 10:21:46

 
You're welcome, I thought it would give a more complete answer, and maybe answer any other questions you might have

lacciap 发表于 2022-7-6 10:24:52

thanks designerstuart and thanks for your help guys!
I like this forum and I hope to be useful to someone in the future.
 
Maybe when I'll a little bit more skilled!

alanjt 发表于 2022-7-6 10:25:50

*cough* ScriptPro or AutoScript *cough*

lacciap 发表于 2022-7-6 10:30:31

Hi everyone,
 
maybe I should open a new thread but since this is the second step of my project after running script files in AutoCAD I write here.
 
I'd like to create a batch application (I use C#) that launch AutoCAD, minimize the AutoCAD window and execute the script file. I found ScriptPro (thanks alanjt!) with its source code and I saw it uses reflection to open and manage AutoCAD, but I don't find the way to minimize AutoCAD window in its code.
Did anybody of you make something similar in your experiences, maybe without reflection?
Thanks again.

fixo 发表于 2022-7-6 10:33:03

You might want to look at this page:
https://sites.google.com/site/bushmansnetlaboratory/lab/pof
(but the explantion is on Russian only - use web translator)

lacciap 发表于 2022-7-6 10:36:35

Thanks for your post fixo.
I'll take a look for sure to that page.
页: [1] 2
查看完整版本: script problem: blank space in