.NET

Reply
*Russ Green
Message 1 of 4 (622 Views)

SendStringToExecute from vb.net

622 Views, 3 Replies
01-03-2006 03:45 PM
I'm haveing trouble sending a command to acad from my vb.net app. I'm
trying to execute a script but the code hangs when passing in the filename
of the script to load.

This is my code:

'set filedia to 0
ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("filedia
", True, False, True)
ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("0
", True, False, True)

'load the script
ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("script
", True, False, True)
ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute(""""
& Me.txtScript.Text & """" & "\n", True, False, True)
'ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("
\n", True, False, True)

'set filedia to 1
ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("filedia",True, False,True)ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("1 ", True, False, True)Please help...
Distinguished Contributor
dmarcotte4
Posts: 195
Registered: ‎04-02-2005
Message 2 of 4 (622 Views)

Re: SendStringToExecute from vb.net

01-03-2006 05:52 PM in reply to: *Russ Green
Try using the SetSystemVariable method for changing system variables like filedia.
here's an example in c#

Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable(name , value);
*Russ Green
Message 3 of 4 (622 Views)

Re: SendStringToExecute from vb.net

01-04-2006 12:16 AM in reply to: *Russ Green
Excellent, thanks.

I fixed the script issue by sending a vbCr in the string.
Valued Contributor
cadprog
Posts: 50
Registered: ‎07-12-2004
Message 4 of 4 (622 Views)

Re: SendStringToExecute from vb.net

09-06-2006 07:23 AM in reply to: *Russ Green
Can you help me too as to what you did to run the script? Coz I can't run the script from VB.net
Thanks
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!