<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Possible to make drawing view label automatically incorporate BOM item number? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12157654#M156170</link>
    <description>&lt;P&gt;The title essentially sums up the post question. If I manually add item numbers to a drawing view label, I have to be aware of any changes in the parts list. Is there a way to make this more automatic, with or without iLogic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="claudioibarra_0-1691519127185.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1250793i158E90748B6D516E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="claudioibarra_0-1691519127185.png" alt="claudioibarra_0-1691519127185.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2023 18:26:55 GMT</pubDate>
    <dc:creator>claudio.ibarra</dc:creator>
    <dc:date>2023-08-08T18:26:55Z</dc:date>
    <item>
      <title>Possible to make drawing view label automatically incorporate BOM item number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12157654#M156170</link>
      <description>&lt;P&gt;The title essentially sums up the post question. If I manually add item numbers to a drawing view label, I have to be aware of any changes in the parts list. Is there a way to make this more automatic, with or without iLogic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="claudioibarra_0-1691519127185.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1250793i158E90748B6D516E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="claudioibarra_0-1691519127185.png" alt="claudioibarra_0-1691519127185.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 18:26:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12157654#M156170</guid>
      <dc:creator>claudio.ibarra</dc:creator>
      <dc:date>2023-08-08T18:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to make drawing view label automatically incorporate BOM item number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12157768#M156174</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6625639"&gt;@claudio.ibarra&lt;/a&gt;.&amp;nbsp; Yes, this does sound possible.&amp;nbsp; In fact, I believe I have seen some other posts here on this forum about essentially the same task, but the view label may have been formatted a bit differently.&amp;nbsp; You could start from the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Sheet_Balloons" target="_blank" rel="noopener"&gt;Sheet.Balloons&lt;/A&gt; collection, because balloons belong to the sheet, not necessarily a &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-DrawingView" target="_blank" rel="noopener"&gt;DrawingView&lt;/A&gt;.&amp;nbsp; Then, once you have a &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Balloon" target="_blank" rel="noopener"&gt;Balloon&lt;/A&gt;, it has a property called &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Balloon_ParentView" target="_blank" rel="noopener"&gt;ParentView&lt;/A&gt; you can use to get a reference to the DrawingView it is associated with.&amp;nbsp; Then you access the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DrawingView_Label" target="_blank" rel="noopener"&gt;DrawingView.Label&lt;/A&gt; property to get the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-DrawingViewLabel" target="_blank" rel="noopener"&gt;DrawingViewLabel&lt;/A&gt; object.&amp;nbsp; But the 'fun' part will be adding that text to its FormattedText String.&amp;nbsp; I don't have time today to go into that task, but I can show you a couple simple little tools to help you see what an existing DrawingViewLabel.FormattedText contains.&lt;/P&gt;
&lt;P&gt;If you prepare the view's label the way you want it manually first, then run this rule, and select that view, it will show you the contents in a way that allows you to copy/edit the contents.&amp;nbsp; Mainly for educational purposes.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oObj = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a Drawing View.")
If oObj Is Nothing OrElse (TypeOf oObj Is DrawingView = False) Then Exit Sub
Dim oView As DrawingView = oObj
Dim sFText As String = oView.Label.FormattedText
Dim sEditedResult As String = InputBox("", "DrawingView.Label.FormattedText", sFText)
'use the next line to set the edited String back as the value for it to use
'oView.Label.FormattedText = sEditedResult&lt;/LI-CODE&gt;
&lt;P&gt;There is also a topic within the API help which talks about how to deal with FormattedText, because it contains XML tags, and can be a bit complicated to deal with at first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 19:03:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12157768#M156174</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-08-08T19:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to make drawing view label automatically incorporate BOM item number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12157811#M156175</link>
      <description>&lt;P&gt;This might be beyond my skill level, but I'm not sure I understand how the workflow would go with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Then, once you have a &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Balloon" target="_blank" rel="noopener"&gt;Balloon&lt;/A&gt;, it has a property called &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Balloon_ParentView" target="_blank" rel="noopener"&gt;ParentView&lt;/A&gt; you can use to get a reference to the DrawingView it is associated with.&amp;nbsp; Then you access the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DrawingView_Label" target="_blank" rel="noopener"&gt;DrawingView.Label&lt;/A&gt; property to get the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-DrawingViewLabel" target="_blank" rel="noopener"&gt;DrawingViewLabel&lt;/A&gt; object.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I have a Balloon and find the ParentView property, is it possible that it has multiple parents? Or would it run into problems if a view has more than one Balloon-able part?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 19:22:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12157811#M156175</guid>
      <dc:creator>claudio.ibarra</dc:creator>
      <dc:date>2023-08-08T19:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to make drawing view label automatically incorporate BOM item number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12159640#M156205</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6625639"&gt;@claudio.ibarra&lt;/a&gt;.&amp;nbsp; Here is a basic example of what I mentioned above.&amp;nbsp; This iLogic rule first makes sure I am working with a drawing, and if not exits the rule.&amp;nbsp; Then it gets the 'active' sheet.&amp;nbsp; Then it gets the first Balloon on the sheet.&amp;nbsp; Then it gets the first value set of the Balloon (they can have multiple).&amp;nbsp; Then it gets the item number from that.&amp;nbsp; (You could also use its ReferencedRow to get DrawingBOMRow related date from it, if you were familiar with what columns (and specific column header text) of data were available in the PartsList.)&amp;nbsp; Then it gets the balloon's parent drawing view.&amp;nbsp; Then it inserts the item number into the view's name.&amp;nbsp; Then it makes sure that the view's label is actually visible.&amp;nbsp; Then it gets the view's label object.&amp;nbsp; Then it edits the label's FormattedText to make sure it is showing the view's name on the first line, then the view's scale, followed by the sheet number on the second line, as you seem to have it in your screen captured image.&amp;nbsp; The FormattedText part may not be necessary, if you have this formatting already set-up that way in your active default &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-DrawingStandardStyle" target="_blank" rel="noopener"&gt;DrawingStandardStyle&lt;/A&gt;.&amp;nbsp; If you do not want to put the item number into the view's regular name, then the other option is to put it into the FormattedText of the DrawingViewLabel object, which gets more complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, if there are multiple balloons on the same sheet that are attached to the same drawing view, that will definitely cause problems with an automation routine like this.&amp;nbsp; I do not know how you normally name your drawing views, but as I pointed out above, you could possibly get more information from the parts list row that the balloon references to help with the first part of the drawing view's name too, but that would require being more familiar with your parts list, what columns are shown, and what the exact text of their column headers is, so we can navigate the cells of the parts list row to get the needed data.&amp;nbsp; There will not be multiple parent drawing views for the same exact balloon object, but yes, it is definitely possible that you may have multiple views with a balloon attached to them with the same item number.&amp;nbsp; Automation by code often requires some forethought and preparation with such situations in mind that might hinder the automation process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
	Dim oDDoc As DrawingDocument = ThisDoc.Document
	Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
	Dim oBalloon As Inventor.Balloon = oSheet.Balloons.Item(1)
	Dim oValSet As BalloonValueSet = oBalloon.BalloonValueSets.Item(1)
	Dim sItemNum As String = oValSet.ItemNumber
	Dim oView As DrawingView = oBalloon.ParentView
	'Option 1:  you could add the Item # to the view's name
	oView.Name = oView.Name &amp;amp; " ITEM " &amp;amp; sItemNum
	If oView.ShowLabel = False Then oView.ShowLabel = True
	Dim oLabel As DrawingViewLabel = oView.Label
	'Option 2:  you could try including the Item Number &amp;amp;/or Part Number / Description into this FormattedText somewhere, instead.
	'Option 2 is a lot more complicated
	oLabel.FormattedText = "&amp;lt;DrawingViewName/&amp;gt;&amp;lt;Br/&amp;gt;SCALE: &amp;lt;DrawingViewScale/&amp;gt; SHT: &amp;lt;DerivedProperty DerivedID='29704'&amp;gt;Sheet Number&amp;lt;/DerivedProperty&amp;gt;"
	oSheet.Update
	oDDoc.Update
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;By the way, here is the link to the online help page for &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-97697345-214B-47F5-816F-F7D0AF5659D3" target="_blank" rel="noopener"&gt;FormattedText&lt;/A&gt;, even though it may just confuse you more than help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 13:28:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12159640#M156205</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-08-09T13:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to make drawing view label automatically incorporate BOM item number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12256619#M158063</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6625639"&gt;@claudio.ibarra&lt;/a&gt;&amp;nbsp; Did the information provided by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;answer your question? If so, please use Accept Solution so that others may find this in the future. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 14:57:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/possible-to-make-drawing-view-label-automatically-incorporate/m-p/12256619#M158063</guid>
      <dc:creator>CGBenner</dc:creator>
      <dc:date>2023-09-21T14:57:00Z</dc:date>
    </item>
  </channel>
</rss>

