.NET

.NET

Reply
Distinguished Contributor
gilseorin
Posts: 177
Registered: ‎09-05-2006
Message 1 of 4 (98 Views)

How can I get text's location value?

98 Views, 3 Replies
10-08-2006 04:24 AM
Hi!
I have an difficulty in getting text's location value.
Any help, I'll appreciate it.
Following code does'nt have any error.
Just add your appropriate code to my one,please.
Thank you in advance.

Public Class class1
_
Public Sub eras()
Try
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim values() As TypedValue = {New TypedValue(0, "Text")}
Dim sfilter As New SelectionFilter(values)
Dim res As PromptSelectionResult = ed.SelectAll(sfilter)
Dim i As Integer
Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
Dim idarray As ObjectId() = SS.GetObjectIds()
Dim objIdColl As New ObjectIdCollection

For i = 0 To idarray.Length - 1
objIdColl.Add(idarray(i))
Next
Finally
End Try
End Sub
End Class
*Paul Richardson
Message 2 of 4 (98 Views)

Re: How can I get text's location value?

10-08-2006 06:16 AM in reply to: gilseorin
Try attached.

wrote in message news:5354518@discussion.autodesk.com...
Hi!
I have an difficulty in getting text's location value.
Any help, I'll appreciate it.
Following code does'nt have any error.
Just add your appropriate code to my one,please.
Thank you in advance.

Public Class class1
_
Public Sub eras()
Try
Dim ed As Editor =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim values() As TypedValue = {New TypedValue(0, "Text")}
Dim sfilter As New SelectionFilter(values)
Dim res As PromptSelectionResult = ed.SelectAll(sfilter)
Dim i As Integer
Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
Dim idarray As ObjectId() = SS.GetObjectIds()
Dim objIdColl As New ObjectIdCollection

For i = 0 To idarray.Length - 1
objIdColl.Add(idarray(i))
Next
Finally
End Try
End Sub
End Class
Distinguished Contributor
gilseorin
Posts: 177
Registered: ‎09-05-2006
Message 3 of 4 (98 Views)

Re: How can I get text's location value?

10-08-2006 06:23 AM in reply to: gilseorin
How happy I am!
I cant't thank you enough, Paul.
It really work well.
God bless you!
*Paul Richardson
Message 4 of 4 (98 Views)

Re: How can I get text's location value?

10-08-2006 07:08 AM in reply to: gilseorin
You're quite welcome. Glad it helped.
wrote in message news:5354493@discussion.autodesk.com...
How happy I am!
I cant't thank you enough, Paul.
It really work well.
God bless you!
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.