Text will not change unless it is on the screen

Text will not change unless it is on the screen

Anonymous
Not applicable
338 Views
3 Replies
Message 1 of 4

Text will not change unless it is on the screen

Anonymous
Not applicable
Can anybody tell me why this wont change the text unless it is displayed on
the screen?

Public Sub cgText()

If OptionButton1.Value = True Then
Dim TxtObj As AcadText
Dim InstPT(0 To 2) As Double
InstPT(0) = 1890: InstPT(1) = 414: InstPT(2) = 0
Dim TxtStr As String
Dim acSelectSet As AcadSelectionSet
Dim acSelectSets As AcadSelectionSets
Set acSelectSets = ThisDrawing.SelectionSets
For Each acSelectSet In acSelectSets
If acSelectSet.Name = "SSET1" Then
acSelectSets.Item("SSET1").Delete
End If
Exit For
Next
Set acSelectSet = acSelectSets.Add("SSET1")
acSelectSet.SelectAtPoint InstPT
For Each TxtObj In acSelectSet
TxtObj.TextString = Label1.Caption
Next
acSelectSet.Delete
End If
If OptionButton2.Value = True Then
InstPT(0) = 1890: InstPT(1) = 414: InstPT(2) = 0
Set acSelectSets = ThisDrawing.SelectionSets
For Each acSelectSet In acSelectSets
If acSelectSet.Name = "SSET1" Then
acSelectSets.Item("SSET1").Delete
End If
Exit For
Next
Set acSelectSet = acSelectSets.Add("SSET1")
acSelectSet.SelectAtPoint InstPT
For Each TxtObj In acSelectSet
TxtObj.TextString = Label2.Caption
Next
acSelectSet.Delete
End If
End Sub
0 Likes
339 Views
3 Replies
Replies (3)
Message 2 of 4

Hallex
Advisor
Advisor
Try
TxtObj.TextString = Label2.Caption
TxtObj.Update

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 3 of 4

Anonymous
Not applicable

No that didn't work. Thanks though. It updates it
if it is displayed on the screen, but if it is not in the field of view of the
screen it wont do anything. Which is weird because I am telling it exactly where
the text is. Guess I'll have to tell it to go to models space then do a zoom all
then change text then go back to where the user was. Seems like a lot of extra
steps to have to go through just to change some text. There has to be an easier
way.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Try
TxtObj.TextString = Label2.Caption TxtObj.Update
~'J'~
0 Likes
Message 4 of 4

Anonymous
Not applicable

Well here I thought I was going to have to jump
through hoops just to get it to go to model space and zoom all. It was actually
pretty easy.

<code>

ThisDrawing.ActiveSpace = acModelSpace

ZoomAll

</code>
0 Likes