.NET

Reply
*perry
Message 1 of 6 (218 Views)

SendStringToExecute space bomb

218 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 (218 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 (218 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 (218 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 (218 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 (218 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
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.