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

How can I get text's location value?

3 REPLIES 3
Reply
Message 1 of 4
gilseorin
423 Views, 3 Replies

How can I get text's location value?

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
3 REPLIES 3
Message 2 of 4
Anonymous
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
Message 3 of 4
gilseorin
in reply to: gilseorin

How happy I am!
I cant't thank you enough, Paul.
It really work well.
God bless you!
Message 4 of 4
Anonymous
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!

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