Autofill Drawing View Label

Autofill Drawing View Label

Anonymous
Not applicable
642 Views
2 Replies
Message 1 of 3

Autofill Drawing View Label

Anonymous
Not applicable

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
0 Likes
Accepted solutions (1)
643 Views
2 Replies
Replies (2)
Message 2 of 3

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

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

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank's perfect. thank you so much

0 Likes