Hi Guys,
I have some pretty basic code here that I want to select a view and have the label text updated. But the code wont work, I havent used VBA for a long time and cant remember why this wont work when directly referenced as below?
Any help would be appreciated...
Public Sub ISO_VIEW()
Dim dwgdoc As DrawingDocument
Set dwgdoc = ThisApplication.ActiveDocument
Set dwgdoc.SelectSet.Item(1).Label.Text = "HELLO WORLD"
End Sub
Solved! Go to Solution.
Solved by YuhanZhang. Go to Solution.
hmmmm, I really confused with this....
I now have the following code and the dwg view shading works fine, but the second command to change the text fails.....
---------------------------------------------------------------
Public Sub ISO_VIEW()
Dim dwgdoc As DrawingDocument
Set dwgdoc = ThisApplication.ActiveDocument
Dim myview As DrawingView
Set myview = dwgdoc.SelectSet.Item(1)
myview.ViewStyle = kShadedDrawingViewStyle
myview.Label.Text = "HELLO WORLD"
End Sub
The DrawingViewLabel.Text now is read-only property. You can use the FormattedText instead.