<?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: Am I the only one? in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/am-i-the-only-one/m-p/5761739#M366011</link>
    <description>&lt;P&gt;Here is a more complete code I made to batch change the View Justification in idw's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only catch is that it should be run from a document that you don't want to change (although it wont change that document in any way) unless you are fine doing that document manually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ie; Add this rule as an External Rule, then run it from a blank template file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;''''Batch opens documents with deferred updates and changes view justification to fixed. - Does this invisibly and saves files afterwards&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sub Main()

Dim oMultiList As New List(Of String)
Dim oDoc As Document
Dim oActiveDoc As Document = ThisApplication.ActiveDocument

Dim oOptions As NameValueMap
	oOptions = ThisApplication.TransientObjects.CreateNameValueMap
	oOptions.Value("DeferUpdates") = True


oMultiList=FBrowseMulti
	
For j=0 To oMultiList.Count-1
	oDoc=ThisApplication.Documents.OpenWithOptions(oMultiList.Item(j),oOptions, False)
    If oDoc.FullFileName = oActiveDoc.FullFileName
		MsgBox("Cannot open active document as deferred; Please change views manually!")
	Else
		FixViewJustification(oDoc)
        oDoc.Save
        oDoc.Close
	End If
Next


End Sub


''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''

Sub FixViewJustification(oDoc As Document)

Dim oSheet As Sheet
Dim oView As DrawingView

For Each oSheet In oDoc.Sheets
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'oSheet.Activate 
        For Each oView In oSheet.DrawingViews
			If oView.Aligned = True Or oView.ViewType = DrawingViewTypeEnum.kSectionDrawingViewType
				'Do Nothing
			Else
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;oView.ViewJustification() =&amp;nbsp;ViewJustificationEnum.kFixedViewJustification
			End If
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next

Next
End Sub


''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''

Private Function FBrowseMulti
	Dim oMultiList As New List(Of String)
    Dim oFileDlg As FileDialog

    Call ThisApplication.CreateFileDialog(oFileDlg)

    With oFileDlg
        .FilterIndex = 1
        .MultiSelectEnabled = True
        .CancelError = True
           On Error Resume Next

            .Filter = "Inventor Files (*.idw;)|*.idw|All Files (*.*)|*.*"
            .DialogTitle = "Select .idw Files To Include In Drawing List"
            .ShowOpen
    End With
    If Err.Number &amp;lt;&amp;gt; 0 Then
        MsgBox("Error Exists")

   ElseIf Not oFileDlg.FileName = "" Then
        Dim fNames As Object
        fNames = Split(oFileDlg.FileName, "|")
        Dim curName As Object

        For Each curName In fNames
            oMultiList.Add(curName)
        Next curName
    End If
Return oMultiList
End Function&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Aug 2015 14:38:02 GMT</pubDate>
    <dc:creator>MechMachineMan</dc:creator>
    <dc:date>2015-08-07T14:38:02Z</dc:date>
  </channel>
</rss>

