Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
brian
544 Views, 3 Replies

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

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

3 REPLIES 3
Message 2 of 4
brian
in reply to: brian

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

Message 3 of 4
YuhanZhang
in reply to: brian

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.

Message 4 of 4
brian
in reply to: YuhanZhang

Thanks so much, I missed that property completley Lol.

 

Bri

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report