<?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: Title block Update and Print PDF in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494186#M96739</link>
    <description>&lt;P&gt;Okay I have Updated the code for the Print Pdf. I am still getting the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is "Change Title Block" trying to run only in the assembly and not the print that is pulled up?&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2017 16:44:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-26T16:44:52Z</dc:date>
    <item>
      <title>Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494076#M96737</link>
      <description>&lt;P&gt;I am a novice at Ilogic. So for give me if there is a simple fix for this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I need to do.&lt;/P&gt;&lt;P&gt;I need to make pdfs for each of the components in the assembly. I have found some ones code for this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to before it makes a PDF is this.&lt;/P&gt;&lt;P&gt;***indicate I have a working ilogic code&lt;/P&gt;&lt;P&gt;1. Copy old prompted entry***&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Update the Scale***&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4. Replace the Title Block***&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;5. Print PDF***&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shouldn't it just be as simple as adding the line below for each of the separate rules?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;RunExternalRule&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;ruleFileName&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I add this to the code and run it I get and error code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 16:10:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494076#M96737</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T16:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494124#M96738</link>
      <description>&lt;P&gt;It should be. With PROPER programming.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You use "ActiveDocument" calls in your code. Active Document calls only grab the document that is at the forefront of the application, not the document the rule was called from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be using ThisDoc.Document to get the document the rule is called from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you might not need to activate each sheet, which slows down code, and could probably just access them directly, but that depends on the capabilities of the functions called.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;**The 2 rules below, the first is the modified version of OP's "PDF Print", the 2nd one is the verbatim text from OP's attached "Change Titleblock.txt"**&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()

&lt;STRONG&gt;On Error Resume Next&lt;BR /&gt;&lt;/STRONG&gt;    Dim oDrawingDoc As Inventor.DrawingDocument: oDrawingDoc = &lt;STRONG&gt;ThisDoc.Document&lt;/STRONG&gt;
    If Err.Number &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;        MsgBox ("Please open a Drawing to work on.")
        Exit Sub&lt;BR /&gt;    End if
&lt;STRONG&gt;On Error GoTo 0&lt;/STRONG&gt;

'reference template
ThisDrawing.ResourceFileName = "C:\Work\InventorResources\Templates\R2017\XXXX.idw"   'XXXX removed name
ThisDrawing.KeepExtraResources = False

Dim SheetNumber As Integer

'Clear out the old Titleblocks &amp;amp; Sheetformats
For SheetNumber = 1 To oDrawingDoc.Sheets.Count
    oDrawingDoc.Sheets(SheetNumber).Activate
    If Not oDrawingDoc.ActiveSheet.TitleBlock Is Nothing Then
        oDrawingDoc.ActiveSheet.TitleBlock.Delete
    End If
Next SheetNumber&lt;BR /&gt;
'Delete the previous title blocks as the API does not support replacing Sheet Formats.'DeleteSheetFormatsAll (oDrawingDoc)'DeleteBorders (oDrawingDoc)
DeleteTitleBlocks (oDrawingDoc)

Dim resu1t As String="Result"
Dim T1TLE As New ArrayList
T1TLE.Add("XXXX")			'XXXX removed name

    ActiveSheet.SetTitleBlock("XXXX", "", "", "")	'XXXX removed name

End Sub

Sub DeleteTitleBlocks(oActiveDoc As Inventor.DrawingDocument)
'Iterate through the collection deleting any titleblocks that are not referenced by the drawing object
Dim oTitle As TitleBlockDefinition
    For Each oTitle In oActiveDoc.TitleBlockDefinitions
        If oTitle.IsReferenced = False Then
        oTitle.Delete
        End If
    Next
End Sub&lt;/PRE&gt;
&lt;PRE&gt;'define the active document as an assembly file
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument
oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4)

'check that the active document is an assembly file
If ThisApplication.ActiveDocument.DocumentType &amp;lt;&amp;gt; kAssemblyDocumentObject Then
MessageBox.Show("Please run this rule from the assembly file.", "iLogic")
Exit Sub
End If

'get user input
RUsure = MessageBox.Show ( _
"This will create a PDF file for all of the asembly components that have drawings files." _
&amp;amp; vbLf &amp;amp; "This rule expects that the drawing file shares the same name and location as the component." _
&amp;amp; vbLf &amp;amp; " " _
&amp;amp; vbLf &amp;amp; "Are you sure you want to create PDF Drawings for all of the assembly components?" _
&amp;amp; vbLf &amp;amp; "This could take a while.", "iLogic  - Batch Output PDFs ",MessageBoxButtons.YesNo)

If RUsure = vbNo Then
Return
Else
End If

'- - - - - - - - - - - - -PDF setup - - - - - - - - - - - -
oPath = ThisDoc.Path
PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

If PDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
'oOptions.Value("All_Color_AS_Black") = 0
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
'oOptions.Value("Custom_Begin_Sheet") = 2
'oOptions.Value("Custom_End_Sheet") = 4
End If

'get PDF target folder path
oFolder = oPath &amp;amp; "\" &amp;amp; oAsmName &amp;amp; " PDF Files"

'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
    System.IO.Directory.CreateDirectory(oFolder)
End If
'- - - - - - - - - - - - -

'- - - - - - - - - - - - -Component Drawings - - - - - - - - - - - -
'look at the files referenced by the assembly
Dim oRefDocs As DocumentsEnumerator
oRefDocs = oAsmDoc.AllReferencedDocuments
Dim oRefDoc As Document

'work the the drawing files for the referenced models
'this expects that the model has a drawing of the same path and name 
For Each oRefDoc In oRefDocs
idwPathName = Left(oRefDoc.FullDocumentName, Len(oRefDoc.FullDocumentName) - 3) &amp;amp; "idw"
'check to see that the model has a drawing of the same path and name 
If(System.IO.File.Exists(idwPathName)) Then
        Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.Documents.Open(idwPathName, True)
    oFileName = Left(oRefDoc.DisplayName, Len(oRefDoc.DisplayName) -3)
    
iLogicVb.RunExternalRule("CAD NAME")
iLogicVb.RunExternalRule("FINISH")
iLogicVb.RunExternalRule("SCALE X")
iLogicVb.RunExternalRule("CHANGE TITLE BLOCK")


    On Error Resume Next ' if PDF exists and is open or read only, resume next
     'Set the PDF target file name
    oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; "pdf"
    'Write out the PDF
    Call PDFAddIn.SaveCopyAs(oDrawDoc, oContext, oOptions, oDataMedium)
    'close the file
    oDrawDoc.Close
Else
'If the model has no drawing of the same path and name - do nothing
End If
Next
'- - - - - - - - - - - - -

'- - - - - - - - - - - - -Top Level Drawing - - - - - - - - - - - -
oAsmDrawing = ThisDoc.ChangeExtension(".idw")
oAsmDrawingDoc = ThisApplication.Documents.Open(oAsmDrawing, True)
oAsmDrawingName = Left(oAsmDrawingDoc.DisplayName, Len(oAsmDrawingDoc.DisplayName) -3)
'write out the PDF for the Top Level Assembly Drawing file
On Error Resume Next ' if PDF exists and is open or read only, resume next
 'Set the PDF target file name
oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oAsmDrawingName &amp;amp; "pdf"
'Write out the PDF
Call PDFAddIn.SaveCopyAs(oAsmDrawingDoc, oContext, oOptions, oDataMedium)
'Close the top level drawing
oAsmDrawingDoc.Close
'- - - - - - - - - - - - -

MessageBox.Show("New Files Created in: " &amp;amp; vbLf &amp;amp; oFolder, "iLogic")
'open the folder where the new ffiles are saved
Shell("explorer.exe " &amp;amp; oFolder,vbNormalFocus)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 16:22:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494124#M96738</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-10-26T16:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494186#M96739</link>
      <description>&lt;P&gt;Okay I have Updated the code for the Print Pdf. I am still getting the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is "Change Title Block" trying to run only in the assembly and not the print that is pulled up?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 16:44:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494186#M96739</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T16:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494531#M96740</link>
      <description>&lt;P&gt;okay the following code will open every drawing,&lt;/P&gt;&lt;P&gt;how do i apply a rule after its open?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;define the active document as an assembly file&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oAsmName&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Left&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Len&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;


&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;check that the active document is an assembly file&lt;/SPAN&gt;
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; &lt;SPAN&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Show&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Please run this rule from the assembly file.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;iLogic&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;Exit Sub&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;- - - - - - - - - - - - -Component Drawings - - - - - - - - - - - -&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;look at the files referenced by the assembly&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oRefDocs&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DocumentsEnumerator&lt;/SPAN&gt;
&lt;SPAN&gt;oRefDocs&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;


&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;work the the drawing files for the referenced models&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;this expects that the model has a drawing of the same path and name &lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oRefDocs&lt;/SPAN&gt;
&lt;SPAN&gt;idwPathName&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Left&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;FullDocumentName&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Len&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;FullDocumentName&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt; &lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;idw&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;check to see that the model has a drawing of the same path and name &lt;/SPAN&gt;
&lt;SPAN&gt;If&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;System&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;IO&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;File&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Exists&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;idwPathName&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
                        &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
                &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Documents&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;idwPathName&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
            &lt;SPAN&gt;oFileName&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Left&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Len&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;


                
&lt;SPAN&gt;Else&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;If the model has no drawing of the same path and name - do nothing&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;- - - - - - - - - - - - -&lt;/SPAN&gt;



 &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 18:26:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494531#M96740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T18:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494600#M96741</link>
      <description>&lt;P&gt;M:Autodesk.iLogic.Interfaces.IiLogicAutomation.RunExternalRule(Inventor.Document,System.String)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Resources:&lt;/P&gt;
&lt;P&gt;-&lt;A href="https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Inventor-Help/files/GUID-28897F28-3C66-4360-85CF-36501D3E7EF2-htm.html" target="_blank"&gt;https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Inventor-Help/files/GUID-28897F28-3C66-4360-85CF-36501D3E7EF2-htm.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- iLogic API Documentation link in my signature&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;    Dim oAsmDoc As AssemblyDocument = ThisDoc.Document&lt;BR /&gt;    If Err.Number &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;        MsgBox("This rules is only valid for assembly documents!",,"MacroMagic")&lt;BR /&gt;        Exit Sub&lt;BR /&gt;    End if &lt;BR /&gt;ON Error GoTo 0&lt;BR /&gt;
oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4)

Dim oRefDocs As DocumentsEnumerator
oRefDocs = oAsmDoc.AllReferencedDocuments
Dim oRefDoc As Document

For Each oRefDoc In oRefDocs
    idwPathName = Left(oRefDoc.FullDocumentName, Len(oRefDoc.FullDocumentName) - 3) &amp;amp; "idw"&lt;BR /&gt;
    If(System.IO.File.Exists(idwPathName)) Then
        Dim oDrawDoc As DrawingDocument
        oDrawDoc = ThisApplication.Documents.Open(idwPathName, True)&lt;BR /&gt;&lt;BR /&gt;        &lt;STRONG&gt;iLogicVb.RunExternalRule(oDrawDoc, "RuleNameHere")&lt;/STRONG&gt;&lt;BR /&gt;
        oFileName = Left(oRefDoc.DisplayName, Len(oRefDoc.DisplayName) -3)&lt;BR /&gt;    End if
Next&lt;BR /&gt;End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 18:48:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494600#M96741</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-10-26T18:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494781#M96742</link>
      <description>&lt;P&gt;Error in rule: OPEN ALL DRAWINGS, in document: 24138-003-0005.iam&lt;/P&gt;&lt;P&gt;Unable to cast COM object of type 'Inventor._DocumentClass' to class type 'System.String'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 19:46:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494781#M96742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T19:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494856#M96743</link>
      <description>&lt;P&gt;The iLogic function call isn't working.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It has in the past, and I even tried getting the applicationaddin, but it still wasn't working.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 20:09:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7494856#M96743</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-10-26T20:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7496433#M96744</link>
      <description>&lt;P&gt;Thanks for the help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will try some different routes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might have to do some things with Code injector and drawing transfer wizard.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 10:59:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7496433#M96744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-27T10:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7501380#M96745</link>
      <description>&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031" target="_blank"&gt;@Curtis_Waguespack&lt;/A&gt;&amp;nbsp;could you take a moment and look this over for me?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 12:17:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7501380#M96745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-30T12:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502247#M96746</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537534"&gt;@MjDeck&lt;/a&gt;&amp;nbsp;might be a better one to see if there is a bug or another issue, if he has time.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 16:25:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502247#M96746</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-10-30T16:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502526#M96747</link>
      <description>&lt;P&gt;I would appreciate any help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I am trying to do the same thing as the Drawing Transfer Wizard, but keep the prompted entry's.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Josh&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 17:47:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502526#M96747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-30T17:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502717#M96748</link>
      <description>&lt;P&gt;You could also just rewrite to rule to be everything within one rule, just utilizing various sub-routines... that way, you don't have to use the iLogic functionality.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 18:44:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502717#M96748</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-10-30T18:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502777#M96749</link>
      <description>&lt;P&gt;I would like to but I am not that good at writing and debugging code.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 19:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502777#M96749</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-30T19:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502814#M96750</link>
      <description>&lt;P&gt;Well then I guess that leaves you with a couple options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Revise your needs&lt;/P&gt;
&lt;P&gt;2. Find a solution online&lt;/P&gt;
&lt;P&gt;3. Pay somebody to make you a solution&lt;/P&gt;
&lt;P&gt;4. Learn how to make your own solution&lt;/P&gt;
&lt;P&gt;5. Hope somebody&amp;nbsp;passes you a solution for free out of the goodness in their heart.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 19:19:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7502814#M96750</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-10-30T19:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7503295#M96751</link>
      <description>&lt;P&gt;Instead of this line:&lt;/P&gt;
&lt;P&gt;iLogicVb.RunExternalRule(oDrawDoc, "RuleNameHere")&lt;/P&gt;
&lt;P&gt;use this:&lt;/P&gt;
&lt;P&gt;iLogicVb.Automation.RunExternalRule(oDrawDoc, "RuleNameHere")&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 23:02:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7503295#M96751</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2017-10-30T23:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Title block Update and Print PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7504365#M96752</link>
      <description>&lt;P&gt;Thank you both for all your help!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 11:15:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/title-block-update-and-print-pdf/m-p/7504365#M96752</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-31T11:15:46Z</dc:date>
    </item>
  </channel>
</rss>

