.NET

Reply
Member
dawoodeg
Posts: 3
Registered: ‎03-03-2010
Message 1 of 7 (936 Views)

How to send the text command from vb.net 2005 to AutoCad 2008

936 Views, 6 Replies
03-06-2010 11:34 PM
Hello,

I`m v.new to programming vb.net 2005 with AutoCAD 2008.
I just saw a presentation about how to send commands through SendStringToExecute method.
My code is like that:
Imports System
Imports System.IO
Imports System.Collections.Generic
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports AcadApp = Autodesk.AutoCAD.ApplicationServices.Application

Public Class DGCommand

_
Public Sub Asdkcmd1()
Dim acDoc As Document = AcadApp.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._text '(10.0 10.0 0.0) 5 0 TestArcGIS", False, False, False)
acDoc.SendStringToExecute("(\n)", False, False, False)
End Sub

End Class

This script code ("._text '(10.0 10.0 0.0) 5 0 TestArcGIS", False, False, False) is not correct.
Can anyone help me with this easy task.

Thanks
*Tony Tanzillo
Message 2 of 7 (936 Views)

Re: How to send the text command from vb.net 2005 to AutoCad 2008

03-07-2010 12:50 PM in reply to: dawoodeg
Can you cite the source of the presentation?


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6350149@discussion.autodesk.com...
Hello,

I`m v.new to programming vb.net 2005 with AutoCAD 2008.
I just saw a presentation about how to send commands through SendStringToExecute
method.
My code is like that:
Imports System
Imports System.IO
Imports System.Collections.Generic
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports AcadApp = Autodesk.AutoCAD.ApplicationServices.Application

Public Class DGCommand

_
Public Sub Asdkcmd1()
Dim acDoc As Document = AcadApp.DocumentManager.MdiActiveDocument
acDoc.SendStringToExecute("._text '(10.0 10.0 0.0) 5 0 TestArcGIS",
False, False, False)

acDoc.SendStringToExecute("(\n)", False, False, False)
End Sub

End Class

This script code ("._text '(10.0 10.0 0.0) 5 0 TestArcGIS", False, False,
False)
is not correct.
Can anyone help me with this easy task.

Thanks
Member
dawoodeg
Posts: 3
Registered: ‎03-03-2010
Message 3 of 7 (936 Views)

Re: How to send the text command from vb.net 2005 to AutoCad 2008

03-08-2010 04:45 AM in reply to: dawoodeg
Hi Tony...

I didn`t get what you want me to do from your question "Can you cite the source of the presentation?".
I explained that it is my first step in using ObjectARX libraries through VB.Net code.

I count in your assistance in order to undertsand some issues regarding those libraries.

So, Can you show me a Vb.net example about the function SendStringToExecute.

Thank you.
*Norman Yuan
Message 4 of 7 (936 Views)

Re: How to send the text command from vb.net 2005 to AutoCad 2008

03-08-2010 05:42 AM in reply to: dawoodeg
There may be cases where using "SendStringToExecute()" makes sense, but
since you are "new to programming...", it is definitely not good way to try
out Acad .NET API. You should avoid the temptation of doing programming as
if you are just issuing Acad built-in commands (running script file *.scr
would be a lot easier for that). SendStringToExecute() is rather advanced
topic.

For your question of creating a text in drawing, there is .NET API
object/method to create text (DBText/MText).


"dawoodeg" wrote in message news:6350149@discussion.autodesk.com...
Hello,

I`m v.new to programming vb.net 2005 with AutoCAD 2008.
I just saw a presentation about how to send commands through
SendStringToExecute method.
My code is like that:
Imports System
Imports System.IO
Imports System.Collections.Generic
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports AcadApp = Autodesk.AutoCAD.ApplicationServices.Application

Public Class DGCommand

_
Public Sub Asdkcmd1()
Dim acDoc As Document =
AcadApp.DocumentManager.MdiActiveDocument

acDoc.SendStringToExecute("._text '(10.0 10.0 0.0) 5 0
TestArcGIS", False, False, False)

acDoc.SendStringToExecute("(\n)", False, False, False)
End Sub

End Class

This script code ("._text '(10.0 10.0 0.0) 5 0 TestArcGIS", False, False,
False)
is not correct.
Can anyone help me with this easy task.

Thanks
*Tony Tanzillo
Message 5 of 7 (936 Views)

Re: How to send the text command from vb.net 2005 to AutoCad 2008

03-08-2010 08:06 AM in reply to: dawoodeg
Where did you get the sample code from?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6350420@discussion.autodesk.com...
Hi Tony...

I didn`t get what you want me to do from your question "Can you cite the source
of the presentation?".
I explained that it is my first step in using ObjectARX libraries through VB.Net
code.

I count in your assistance in order to undertsand some issues regarding those
libraries.

So, Can you show me a Vb.net example about the function SendStringToExecute.

Thank you.
Member
dawoodeg
Posts: 3
Registered: ‎03-03-2010
Message 6 of 7 (936 Views)

Re: How to send the text command from vb.net 2005 to AutoCad 2008

03-08-2010 11:15 PM in reply to: dawoodeg
Greetings,

Mr. Norman... Please note that I have 2 years experience as a GIS Developer and I want to create a tool that add attributes like those of GIS features to CAD features and let the Cad user assign data to these attributes through an interface.

Mr. Tony...Upon your request, the source of the sample code. I got it from the DS09_TS_83_AutoCAD.wmv demo.

My question was to find the alternate code in vb.net of the following line of code:
acDoc.SendStringToExecute("command \"_text\" '(10.0 10.0 0.0) 200 0 \"Hello, World\")",false, false, false);

Thank you a lot guys...
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 7 of 7 (936 Views)

Re: How to send the text command from vb.net 2005 to AutoCad 2008

03-09-2010 02:29 AM in reply to: dawoodeg
A google search of that demo only turns up this post. Where did that demo come from?
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.