<?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 Re: iLogic Drawing View File Type Identification in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7252493#M270307</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Use this instead of oModel&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dim oViewModelDoc As Document&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oViewModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'DETERMINE MODEL TYPE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If oViewModelDoc.DocumentType = kPartDocumentObject Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oView.Label.FormattedText = oPartNumber &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oStringMaterial &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oPartQty &amp;amp; " RQD "&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oView.Label.FormattedText = oPartNumber &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oPartQty &amp;amp; " RQD "&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2017 13:02:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-25T13:02:26Z</dc:date>
    <item>
      <title>iLogic Drawing View File Type Identification</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7246700#M270304</link>
      <description>&lt;P&gt;Hey guys.&lt;/P&gt;
&lt;P&gt;This should be an easy one for you in the know...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply trying to determine if a drawing view is an assembly or part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code is skipping something because it always uses the first solution in the IF statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See red code...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;'iterate through a IDW and add "Part Number, Total Part Qty" to the base view labels

Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oModel = ThisDoc.ModelDocument
Dim oSheets As Sheets = oDoc.Sheets
Dim oSheet As Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView

For Each oSheet In oSheets
	oViews = oSheet.DrawingViews
	For Each oView In oViews
		'oView.ViewType = DrawingViewTypeEnum.kDetailDrawingViewType _
		'oView.ViewType = DrawingViewTypeEnum.kSectionDrawingViewType
		If oView.ViewType = DrawingViewTypeEnum.kStandardDrawingViewType Then
		
		'if viel label is hidden, unhide
		oView.ShowLabel = True
		
			Try
			'get the property ID for these custom iProperties from the model referenced by the view
			o_iPropID_1 = oModel.PropertySets.Item("User Defined Properties").Item("TotalPartQty").PropId
			o_iPropID_2 = oModel.PropertySets.Item("User Defined Properties").Item("My_iProp_2").PropId
			Catch
			'here you could add a message that one or more of the custom iProperties were not found
			End Try
			Try
			'format the custom iproperty string and add the property ID
			oPartQty = "&amp;lt;Property Document='model' PropertySet='User Defined Properties' " _
			&amp;amp; "Property='TotalPartQty' FormatID='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}' PropertyID='" _
			&amp;amp; o_iPropID_1 &amp;amp; "'&amp;gt;TotalPartQty&amp;lt;/Property&amp;gt;"
			
			''format the custom iproperty string and add the property ID
			'oString2 = "&amp;lt;Property Document='model' PropertySet='User Defined Properties' " _
			'&amp;amp; "Property='My_iProp_2' FormatID='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}' PropertyID='" _
			'&amp;amp; o_iPropID_2 &amp;amp; "'&amp;gt;My_iProp_2&amp;lt;/Property&amp;gt;"
			
			'format the built in iproperty string and add the property ID
			oPartNumber = "&amp;lt;StyleOverride Bold='false' Underline='false'&amp;gt;&amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'&amp;gt;PART NUMBER&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			'oStockNumber = "&amp;lt;Br/&amp;gt;&amp;lt;StyleOverride Bold='false' Underline='false'&amp;gt;&amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Stock Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'&amp;gt;STOCK NUMBER&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			'oStringScale = "&amp;lt;StyleOverride FontSize='0.2'&amp;gt; FLAT VIEW (&amp;lt;DrawingViewScale/&amp;gt;)&amp;lt;/StyleOverride&amp;gt;"
			'oPartNumber = "&amp;lt;Br/&amp;gt;&amp;lt;StyleOverride Underline='False' FontSize='0.2'&amp;gt;PART ID:    &amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'&amp;gt;PART NUMBER&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			'oStringProfile = "&amp;lt;Br/&amp;gt;&amp;lt;StyleOverride FontSize='0.2'&amp;gt;PROFILE:   &amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'&amp;gt;DESCRIPTION&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			oStringMaterial = "&amp;lt;StyleOverride Underline='False'&amp;gt;&amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='20'&amp;gt;PART NUMBER&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			'oStringAuth = "&amp;lt;Br/&amp;gt;&amp;lt;StyleOverride Underline='False' FontSize='0.2'&amp;gt;QTY:        &amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Authority' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'&amp;gt;AUTHORITY&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			
			
				'add the custom iproperties to the view label
				'oView.Label.FormattedText = "&amp;lt;DrawingViewName/&amp;gt;&amp;lt;Br/&amp;gt;" &amp;amp; oString1 &amp;amp; oString2
				
				'Here Is a list Of all Of the the DocumentType enumerators available In the API:
				'kUnknownDocumentObject 
				'kPartDocumentObject 
				'kAssemblyDocumentObject 
				'kDrawingDocumentObject 
				'kPresentationDocumentObject 
				'kDesignElementDocumentObject 
				'kForeignModelDocumentObject 
				'kSATFileDocumentObject  
				'kNoDocument
				
				&lt;FONT color="#FF0000"&gt;'DETERMINE MODEL TYPE
				'If oModel.DocumentType = kPartDocumentObject  Then
				oView.Label.FormattedText = oPartNumber &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oStringMaterial &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oPartQty &amp;amp; " RQD " 
				'Else
				'oView.Label.FormattedText = oPartNumber &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oPartQty &amp;amp; " RQD "
				'End If&lt;/FONT&gt;			
			
			Catch
			'do nothing if error
			End Try
		End If
	Next
Next

&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jul 2017 11:39:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7246700#M270304</guid>
      <dc:creator>chrisw01a</dc:creator>
      <dc:date>2017-07-22T11:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Drawing View File Type Identification</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7247374#M270305</link>
      <description>&lt;P&gt;I think you need to get type of model from each view rather than setting it globally at the beginning of the code. On some drawings, you could have both assemblies and parts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;If oModel.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject  Then&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 08:23:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7247374#M270305</guid>
      <dc:creator>salariua</dc:creator>
      <dc:date>2017-07-23T08:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Drawing View File Type Identification</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7249155#M270306</link>
      <description>I briefly considered that but the code has been working as it is for putting&lt;BR /&gt;the view labels on.&lt;BR /&gt;&lt;BR /&gt;I will look into this.  Thank you.&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Jul 2017 12:21:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7249155#M270306</guid>
      <dc:creator>chrisw01a</dc:creator>
      <dc:date>2017-07-24T12:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Drawing View File Type Identification</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7252493#M270307</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Use this instead of oModel&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dim oViewModelDoc As Document&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oViewModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'DETERMINE MODEL TYPE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If oViewModelDoc.DocumentType = kPartDocumentObject Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oView.Label.FormattedText = oPartNumber &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oStringMaterial &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oPartQty &amp;amp; " RQD "&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oView.Label.FormattedText = oPartNumber &amp;amp; "&amp;lt;Br/&amp;gt;" &amp;amp; oPartQty &amp;amp; " RQD "&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 13:02:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7252493#M270307</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-25T13:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Drawing View File Type Identification</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7252575#M270308</link>
      <description>&lt;P&gt;Thank you for your help.&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 13:21:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-drawing-view-file-type-identification/m-p/7252575#M270308</guid>
      <dc:creator>chrisw01a</dc:creator>
      <dc:date>2017-07-25T13:21:24Z</dc:date>
    </item>
  </channel>
</rss>

