RULE to Underline All View Labels in Drawing Sheet(s)

RULE to Underline All View Labels in Drawing Sheet(s)

RoyWickrama_RWEI
Advisor Advisor
670 Views
4 Replies
Message 1 of 5

RULE to Underline All View Labels in Drawing Sheet(s)

RoyWickrama_RWEI
Advisor
Advisor

I am planning to create a small rule for underlining all the view labels in the drawing sheets.

Could someone provide me with some help.

 

2019-05-10 11_58_39.png

0 Likes
671 Views
4 Replies
Replies (4)
Message 2 of 5

ianteneth
Advocate
Advocate

Hi! Here is some code that will underline the drawing view labels. Should be a good starting point to do what you need. I did notice some strange side effects. For one, I did not expect hole callouts to be considered a DrawingViewLabel object. Second, after running this code any new views I placed automatically had underlined labels. Lastly, I don't think it works for Detail views, but the algorithm would be similar. Hope this helps!

 

Sub Main()
	
    ' Get current drawing. Assume a drawing is open
    Dim drawing As Inventor.DrawingDocument = ThisDoc.Document
	
	' Loop through all the views on the first sheet of the drawing
	For Each view As Inventor.DrawingView In drawing.Sheets(1).DrawingViews
		
		' Get the view label
		Dim label As Inventor.DrawingViewLabel = View.Label
		
		' Set the label style to be underlined
		label.TextStyle.Underline = True
	Next View
	
End Sub
Message 3 of 5

RoyWickrama_RWEI
Advisor
Advisor

Thanks for the reply.

But, as per the template,  it is a note that starts from "MARK NUMBER".

 

Could you help to underline the text that starts from "MARK NUMBER".

 

Thanks.

 

0 Likes
Message 4 of 5

mslosar
Advisor
Advisor

As long as the text is in the view label object, it will under whatever text is contained in that object. It's not underlining certain text, it underlines all text in the View Label that way.

Message 5 of 5

RoyWickrama_RWEI
Advisor
Advisor

Thanks for the reply. This is not a view label, just a set of words caring some info. But need to under line the whole textual content when it finds the search text contains therein. 

0 Likes