.NET

Reply
*perry
Message 1 of 6 (225 Views)

SendStringToExecute space bomb

225 Views, 5 Replies
06-01-2006 08:32 AM
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
*Owen Wengerd
Message 2 of 6 (225 Views)

Re: SendStringToExecute space bomb

06-01-2006 10:39 AM in reply to: *perry
Perry:

File names with spaces need to be enclosed in double quotes. :smileyhappy:
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
*perry
Message 3 of 6 (225 Views)

Re: SendStringToExecute space bomb

06-01-2006 11:16 AM in reply to: *perry
Owen Wengerd wrote:
> Perry:
>
> File names with spaces need to be enclosed in double quotes. :smileyhappy:
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
*Tony Tanzillo
Message 4 of 6 (225 Views)

Re: SendStringToExecute space bomb

06-01-2006 12:49 PM in reply to: *perry
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. :smileyhappy:
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
*perry
Message 5 of 6 (225 Views)

Re: SendStringToExecute space bomb

06-01-2006 01:44 PM in reply to: *perry
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!
*perry
Message 6 of 6 (225 Views)

Re: SendStringToExecute space bomb

06-01-2006 02:24 PM in reply to: *perry
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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.