<?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 rule for create .Idw Automation in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9667329#M114005</link>
    <description>&lt;P&gt;Hi Tyas Swinnen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help. The programme is similar to what I am looking for.&amp;nbsp; I have tried to run the rule, but I am getting the Sub main () and End Sub error. I try to fix with the help of Google, it didn't work. I can understand it must be a small issue. could you please guide me to fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;</description>
    <pubDate>Sat, 01 Aug 2020 04:20:54 GMT</pubDate>
    <dc:creator>justin.johnsonQLTK2</dc:creator>
    <dc:date>2020-08-01T04:20:54Z</dc:date>
    <item>
      <title>ilogic rule for create .Idw Automation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9665718#M113967</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am working on a new project, so it has more than 500 drawings to create.&lt;/P&gt;&lt;P&gt;Is there any way to create .Idw automatically when we create .ipt or .iam ?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;or&lt;/P&gt;&lt;P&gt;Is there any ilogic code or tool to create batch .idw from an assembly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Justin&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>Fri, 31 Jul 2020 05:43:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9665718#M113967</guid>
      <dc:creator>justin.johnsonQLTK2</dc:creator>
      <dc:date>2020-07-31T05:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: ilogic rule for create .Idw Automation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9665823#M113968</link>
      <description>&lt;P&gt;Hi Justin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a VBA script to iterate through my assemblies and check if they already have a drawing file.&lt;/P&gt;&lt;P&gt;If not, it creates them (and does some extra's).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here some functions of my script to set you going: (I'm not saying this is the most efficient way to do this, but hey, for now it works :-), feedback always welcome!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Function Excecute(ByVal oDoc As Document, textLocation As String)
        
        Debug.Print oDoc.FullFileName
        
        If CheckNaam(oDoc) Then
                
            Dim drawingFilename As String
                drawingFilename = FindDrawingFile(oDoc)
            
            Dim tempName As String
                tempName = Right(oDoc.FullFileName, 15)
            
            Dim saveName As String
                saveName = Left(oDoc.FullFileName, Len(oDoc.FullFileName) - 4) &amp;amp; ".idw"
            
            If drawingFilename &amp;lt;&amp;gt; "" Then
                Call TextFile(textLocation, "The drawing for """ &amp;amp; tempName &amp;amp; """ was found: " &amp;amp; vbCr &amp;amp; drawingFilename)
                'MsgBox "The drawing for """ &amp;amp; tempName &amp;amp; """ was found: " &amp;amp; vbCr &amp;amp; drawingFilename
                            
            Else
                Dim oNewName As String
                oNewName = oDoc.FullDocumentName
                
                'Call TextFile(textLocation, "Trying: " &amp;amp; oNewName)
                
                ThisApplication.SilentOperation = True
                
                Dim oDrawing As DrawingDocument
                Set oDrawing = ThisApplication.Documents.Add(kDrawingDocumentObject, **insert your desired .idw template location here**, False)
                 
                Call PlaceView(oDrawing, oDoc)
                
                Select Case oDoc.DocumentType
                    Case DocumentTypeEnum.kAssemblyDocumentObject:
                        'Call to parts list insertion function
                        'Call to correct assy titleblock insertion
                    Case DocumentTypeEnum.kPartDocumentObject:
                    Case Else: Exit Function
                End Select
                
                'MsgBox saveName
                
                saveName = Left(oNewName, Len(oNewName) - 4) + ".idw"
                
                Call oDrawing.SaveAs(saveName, False)
                oDrawing.Close (True)
                
                ThisApplication.SilentOperation = True
                
                'Call TextFile(textLocation, "A drawingdocument was created for '" &amp;amp; saveName &amp;amp; "'")
                            
            End If
        End If
    
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Function PlaceView(ByVal oDrawing As DrawingDocument, oRefDoc As Document)

    Dim oSheet As Sheet
    Set oSheet = oDrawing.ActiveSheet

    Dim oPlacementPoint1 As Point2d
    Dim oPlacementPoint2 As Point2d
    Dim oPlacementPoint3 As Point2d
    
    Set oPlacementPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(12.5, 20)
    Set oPlacementPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(25, 20)
    Set oPlacementPoint3 = ThisApplication.TransientGeometry.CreatePoint2d(12.5, 10)

    ' Define the view scales that we need.
    Dim ViewScale1 As Double
    If oRefDoc.DocumentType = kPartDocumentObject Then
        ViewScale1 = CalculateScale(getRangeboxLargest(oRefDoc)) '1#
    Else
        ViewScale1 = 1#
    End If
    
    ' define the view orientation for each view
    Dim ViewOrientation1 As ViewOrientationTypeEnum
        ViewOrientation1 = ViewOrientationTypeEnum.kFrontViewOrientation

    ' define the view style for each view
    Dim ViewStyle1 As DrawingViewStyleEnum
        ViewStyle1 = DrawingViewStyleEnum.kHiddenLineDrawingViewStyle
 
    ' now create our view
    Dim oView1 As DrawingView
    Dim oView2 As DrawingView
    Dim oView3 As DrawingView
    
    Set oView1 = oSheet.DrawingViews.AddBaseView(oRefDoc, oPlacementPoint1, ViewScale1, ViewOrientation1, ViewStyle1)
    If Not oView1.ActiveLevelOfDetailRepresentation = "Master" Then
        oView1.ActiveLevelOfDetailRepresentation = "Master"
    End If
    
    If oRefDoc.DocumentType = kPartDocumentObject Then
        Set oView2 = oSheet.DrawingViews.AddProjectedView(oView1, oPlacementPoint2, DrawingViewStyleEnum.kFromBaseDrawingViewStyle)
        Set oView3 = oSheet.DrawingViews.AddProjectedView(oView1, oPlacementPoint3, DrawingViewStyleEnum.kFromBaseDrawingViewStyle)
    End If

End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Public Function FindDrawingFile(PartOrAssemblyDoc As Document)

    Dim FullFileName As String
    FullFileName = PartOrAssemblyDoc.FullFileName
    
    ' Extract the path from the full filename.
    Dim path As String
    path = Left$(FullFileName, InStrRev(FullFileName, "\"))
    
    ' Extract the filename from the full filename.
    Dim filename As String
    filename = Right$(FullFileName, Len(FullFileName) - InStrRev(FullFileName, "\"))
    
    ' Replace the extension with "idw"
    filename = Left$(filename, InStrRev(filename, ".")) &amp;amp; "idw"
    
    ' Find if the drawing exists.
    Dim drawingFilename As String
    drawingFilename = ThisApplication.DesignProjectManager.ResolveFile(path, filename)
    
    ' Return the result.
    If drawingFilename &amp;lt;&amp;gt; "" Then
        FindDrawingFile = drawingFilename
    Else
        FindDrawingFile = ""
    End If
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 06:59:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9665823#M113968</guid>
      <dc:creator>tyas.swinnen</dc:creator>
      <dc:date>2020-07-31T06:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: ilogic rule for create .Idw Automation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9667329#M114005</link>
      <description>&lt;P&gt;Hi Tyas Swinnen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help. The programme is similar to what I am looking for.&amp;nbsp; I have tried to run the rule, but I am getting the Sub main () and End Sub error. I try to fix with the help of Google, it didn't work. I can understand it must be a small issue. could you please guide me to fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 04:20:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9667329#M114005</guid>
      <dc:creator>justin.johnsonQLTK2</dc:creator>
      <dc:date>2020-08-01T04:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: ilogic rule for create .Idw Automation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9667535#M114008</link>
      <description>&lt;P&gt;My approach was to set up template files and use the replace reference option.&lt;/P&gt;&lt;P&gt;See if this will work for you (with a few tweaks)&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://clintbrown.co.uk/2018/10/07/automatic-drawings-with-ilogic/" target="_blank" rel="noopener"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-10-05_14h36_42.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802100i6AE7763928E0119A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2018-10-05_14h36_42.png" alt="2018-10-05_14h36_42.png" /&gt;&lt;/span&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 11:24:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9667535#M114008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-01T11:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: ilogic rule for create .Idw Automation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9669338#M114037</link>
      <description>&lt;P&gt;Justin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, my code is suited for VBA, and not iLogic.&lt;/P&gt;&lt;P&gt;If you just have copy-pasted my code in iLogic you will get even more errors after 'fixing' the first one. &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suggest you read over my used code as a guide to see how I tackled the problem.&lt;/P&gt;&lt;P&gt;Then you can modify it to your needs/use bits and pieces of it so you understand the script you are making.&lt;/P&gt;&lt;P&gt;(You can ignore the 'Textfile' calls because I did not gave you those lines of code.)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 08:55:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9669338#M114037</guid>
      <dc:creator>tyas.swinnen</dc:creator>
      <dc:date>2020-08-03T08:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: ilogic rule for create .Idw Automation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9671224#M114060</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IDW RULE.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802944i9A7ED25DABAA6D92/image-size/large?v=v2&amp;amp;px=999" role="button" title="IDW RULE.PNG" alt="IDW RULE.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ERROR IDW RULE.PNG" style="width: 864px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802945i9E6CE6D027409F8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="ERROR IDW RULE.PNG" alt="ERROR IDW RULE.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TEMPLATE LOCATION.PNG" style="width: 871px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802947i7CE2BB4CD38F67CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="TEMPLATE LOCATION.PNG" alt="TEMPLATE LOCATION.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the above error, what am I doing wrong here?&amp;nbsp; Please guide me.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 05:53:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9671224#M114060</guid>
      <dc:creator>justin.johnsonQLTK2</dc:creator>
      <dc:date>2020-08-04T05:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: ilogic rule for create .Idw Automation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9671276#M114063</link>
      <description>&lt;P&gt;Hi Justin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you step through your code (open vba editor, click in your script and press F8). Can you tell us on what line gives the error?&lt;/P&gt;&lt;P&gt;Can you include the file extension in the template name in your code. (oCopyFiler -&amp;gt; add .idw in the hard coded templatelocation)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 06:44:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-for-create-idw-automation/m-p/9671276#M114063</guid>
      <dc:creator>tyas.swinnen</dc:creator>
      <dc:date>2020-08-04T06:44:32Z</dc:date>
    </item>
  </channel>
</rss>

