.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SendStringToExecute space bomb

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
443 Views, 5 Replies

SendStringToExecute space bomb

I dont know if this behavior is consistent, but using "sendstring" in order to load a cui file
bombs if the name/path of the file has spaces in it. The following command hoses miserably
if "tbCuiName" is something like "c:\\program files\\blah blah"

Application.DocumentManager.MdiActiveDocument.SendStringToExecute("cuiload " + tbCuiName + " filedia 1 ", false, false, false);

I REALLY need to load this file, is there a workaround?
Thanks, Perry
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Perry:

File names with spaces need to be enclosed in double quotes. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
Message 3 of 6
Anonymous
in reply to: Anonymous

Owen Wengerd wrote:
> Perry:
>
> File names with spaces need to be enclosed in double quotes. 🙂
Thanks Owen
the variable I was sending to sendstring evaluates so:
"C:\\Documents and Settings\\perry\\My Documents\\My code\\C#\\Acad\\Tblocker2007\\bin\\Debug\\tblocker.cui"

However, if I move the cui file and call the command with:
"c:\\tblocker.cui"
it works
Message 4 of 6
Anonymous
in reply to: Anonymous

SendStringToExecute("\"C:\My filename with spaces.txt\"");

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"perry" wrote in message news:5192653@discussion.autodesk.com...
Owen Wengerd wrote:
> Perry:
>
> File names with spaces need to be enclosed in double quotes. 🙂
Thanks Owen
the variable I was sending to sendstring evaluates so:
"C:\\Documents and Settings\\perry\\My Documents\\My code\\C#\\Acad\\Tblocker2007\\bin\\Debug\\tblocker.cui"

However, if I move the cui file and call the command with:
"c:\\tblocker.cui"
it works
Message 5 of 6
Anonymous
in reply to: Anonymous

Tony Tanzillo wrote:
> SendStringToExecute("\"C:\My filename with spaces.txt\"");
>
"Double Double" quotes?
You know, I actually thought about doing that Tony,
then I thought, Naw, that would be silly!
Message 6 of 6
Anonymous
in reply to: Anonymous

Well, I tacked extra quotes to the variable which now evaluates to:
"\"C:\\Documents and Settings\\perry\\My Documents\\My code\\C#\\Acad\\Tblocker2007\\bin\\Debug\\tblocker.cui\""
and it work, seems odd but as long as it works thats all that matters.
Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost