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: 

Autofill Drawing View Label

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
544 Views, 2 Replies

Autofill Drawing View Label

I'm looking to autofill the View label in the Base View dialog box.  in the past, I used some code that adds the words in the Format Text dialog box (see code below).  This however, doesn't change the view name in the model browser.

 

Thank you for your help.

 

'Adds View Label 
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet
Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oSheet As Sheet = oDoc.ActiveSheet
If oSSet.Count = 0 Then
    MessageBox.Show("You must select a drawing view first", "iLogic")
Exit Sub
End If
 

'Reference to the drawing view from the 1st selected object
Dim oView As DrawingView = TryCast(oSSet.Item(1), DrawingView)

If oView IsNot Nothing Then
oView.ShowLabel = True
'format the model iproperties   
oView.Label.FormattedText = "ISOMETRIC VIEW"
oStringScale = "<Br/><StyleOverride FontSize='0.5'>SCALE <DrawingViewScale/></StyleOverride>"


'add to the view label
oView.Label.FormattedText =  "ISOMETRIC VIEW" 
oView.Label.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextCenter
Else
    MessageBox.Show("The selected object is not a drawing view", "iLogic")
End If
2 REPLIES 2
Message 2 of 3
Sergio.D.Suárez
in reply to: Anonymous

Hi, with the following ilogic code you can change the name of the view that appears in the model browser.

 

Dim oView As DrawingView= ThisApplication.CommandManager.Pick(16898, "Select View")												
oView.Name = oView.Name.ToUpper.Replace(oView.Name,"New Name")	

 I hope this helps with your problem. Cheers


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 3
Anonymous
in reply to: Sergio.D.Suárez

Thank's perfect. thank you so much

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

Post to forums  

Autodesk Design & Make Report