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

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

6 REPLIES 6
Reply
Message 1 of 7
dawoodeg
1494 Views, 6 Replies

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

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
6 REPLIES 6
Message 2 of 7
Anonymous
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
Message 3 of 7
dawoodeg
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.
Message 4 of 7
Anonymous
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
Message 5 of 7
Anonymous
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.
Message 6 of 7
dawoodeg
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...
Message 7 of 7
NathTay
in reply to: dawoodeg

A google search of that demo only turns up this post. Where did that demo come from?

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