Simple view label text change.... wont work?

Simple view label text change.... wont work?

brian
Advocate Advocate
649 Views
3 Replies
Message 1 of 4

Simple view label text change.... wont work?

brian
Advocate
Advocate

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

0 Likes
Accepted solutions (1)
650 Views
3 Replies
Replies (3)
Message 2 of 4

brian
Advocate
Advocate

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

0 Likes
Message 3 of 4

YuhanZhang
Autodesk
Autodesk
Accepted solution

The DrawingViewLabel.Text now is read-only property. You can use the FormattedText instead.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 4 of 4

brian
Advocate
Advocate

Thanks so much, I missed that property completley Lol.

 

Bri

0 Likes