Modify <VIEW IDENTIFIER> programmatically

Modify <VIEW IDENTIFIER> programmatically

Curtis_Waguespack
Consultant Consultant
458 Views
4 Replies
Message 1 of 5

Modify <VIEW IDENTIFIER> programmatically

Curtis_Waguespack
Consultant
Consultant
  • I have a drawing with a section view.
  • I want to add some text to the View Identifiers, example: A becomes A-88 as shown.
  • I do not want to change the label text, meaning I want the section view label to remain SECTION A-A.
  • There is no API support for the section line view identifier text, so we can not access that programmatically
    • feel free to correct me if I am wrong about that

This is a step of a larger automation piece.

 

Does anyone have any ideas of how we might go about this?

 

Currently, the best idea we have is to attempt to programmatically select the section line, by first filtering for only those, or using some layer control, etc. And then execute a command to edit the text, use send key to press the OK button, etc.

 

  • Have any of you ever done something similar? 
  • Anyone have any ideas on this?
  • @MjDeck do you have any thoughts on the best way to approach this?

 

Thanks in advance!

 

Curtis_Waguespack_1-1733930593208.png

 

EESignature

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

marcin_otręba
Advisor
Advisor

hi Curtis,

 

maybe this will be your answer ?:

Dim drawv As DrawingView= ThisApplication.ActiveDocument.SelectSet(1)
Dim suffix As String = "-88"

drawv.Label.FormattedText = Replace(drawv.Label.FormattedText, "<DrawingViewName/>", "<DrawingViewName/>" & suffix)
'or:
drawv.Label.FormattedText = "<DrawingViewName/>" & suffix

 

ok, i see now that you want opposite situation, then maybe you can start from this code:

 

Dim drawv As DrawingView = ThisApplication.ActiveDocument.SelectSet(1)
Dim suffix As String = "-88"
If Not drawv.Name.Contains(suffix) Then drawv.Name = drawv.Name & suffix
drawv.Label.FormattedText = "Section: " & Replace(drawv.Name, suffix, "") & "-" & Replace(drawv.Name, suffix, "")

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 3 of 5

MjDeck
Autodesk
Autodesk

Hi Curtis - as you said, if you want to do it in Inventor 2025 and earlier you would have to try to use UI automation.
However, it is available now in a Beta on feedback.autodesk.com. This is internal story INVGEN-77304. If you ask a question on the Inventor API forum on the feedback site we can provide more details.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 4 of 5

jnowel
Advocate
Advocate

Hi @MjDeck,

Is a way to track the Section View's Sheet number and Parent View's Sheet number be included in that update?
Say, like a 'dynamic' property that can be dropped down in the textbox.
Anyway, having 'easy' access to that specific text box is a good start (I've used a SkectchedSymbol as placeholder for the additional texts before)


0 Likes
Message 5 of 5

MjDeck
Autodesk
Autodesk

Hi @jnowel - in the Beta, it's likely that you can use iLogic to put sheet information in the section line label. If you want more detail, please ask on feedback.autodesk.com.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes