<?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: Issues with my first macro in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297747#M89358</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4898893"&gt;@J-Camper&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An short snippet and example of how to do it in VBA:&lt;/P&gt;&lt;PRE&gt;Public Sub AUTOSAVE()

' Connect to a running instance of Inventor.
Dim invApp As Inventor.Application
Set invApp = Thisapplication 'System.Runtime.InteropServices.Marshal.GetActiveObject _
                                            ("Inventor.Application")
' Get the Documents collection.
Dim oDocs As Inventor.Documents
Set oDocs = invApp.Documents

' Get the Active part document.
Dim ThisDoc As Inventor.Documents
Set ThisDoc = invApp.ActiveDocument&lt;BR /&gt;&lt;BR /&gt;Set APE as Integer&lt;BR /&gt;APE =1&lt;BR /&gt;Set NOTE as Boolean&lt;BR /&gt;NOTE = True&lt;BR /&gt;Set BANANAN as string&lt;BR /&gt;BANANA = "This Banana"&lt;/PRE&gt;&lt;P&gt;For I-logic&amp;nbsp; all the sets are not neccessary...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Autodesk Software:&lt;/STRONG&gt; Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018&lt;BR /&gt;&lt;STRONG&gt;Programming Skills:&lt;/STRONG&gt; Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/dimension-component-part-and-assembly/idi-p/7523011" target="_blank"&gt;Dimension Component!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/export-partlist-default-configuration/idc-p/7422221#M21416" target="_blank"&gt;Partlist Export!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/derived-part-and-assembly-copy-i-properties/idi-p/6349392" target="_blank"&gt;Derive I-properties!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/inventor-vault-prompts-settings-amp-vault-prompts-settings-via/idi-p/7641767" target="_blank"&gt;Vault Prompts Via API!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/vault-ideas/vault-professional-handbook-or-manual-to-be-provided/idi-p/7653669" target="_blank"&gt;Vault Handbook/Manual!&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/drawing-toggle-sheets/idi-p/7708757" target="_blank"&gt;Drawing Toggle Sheets!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/open-files-automatically-with-quot-defer-update-quot-on-read/idi-p/7762709" target="_blank"&gt;Vault Defer Update!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;! For administrative reasons, please mark a &lt;STRONG&gt;"Solution as solved"&lt;/STRONG&gt; when the issue is solved !&lt;/P&gt;</description>
    <pubDate>Thu, 27 Sep 2018 19:35:39 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2018-09-27T19:35:39Z</dc:date>
    <item>
      <title>Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297239#M89352</link>
      <description>&lt;P&gt;I am just getting into using Inventor's API, and I would like some help getting in the right direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a basic Autosave macro online:&lt;/P&gt;&lt;PRE&gt;Public Sub TimerSetting()
    i = InputBox("Input Timer", "Timer Form")
    i = i * 60
    If i &amp;gt; 600 Then
        MsgBox ("30min MAXIMUM, TIMER SET TO 30min")
        i = 600
    ElseIf i &amp;lt; 60 Then
        MsgBox ("1min MINIMUM, TIMER SET TO 1min")
        i = 60
    End If
   
    Dim SetTimer, Start, Finish, TotalTime
    SetTimer = i ' Set duration.
       
        Start = Timer    ' Set start time.
    Do While Timer &amp;lt; Start + SetTimer
        DoEvents    ' Yield to other processes.
    Loop
        Finish = Timer    ' Set end time.
        TotalTime = Finish - Start    ' Calculate total time.
       
        Dim oDoc As Document
            Set oDoc = ThisApplication.ActiveDocument
        oDoc.Save2 (True)
        MsgBox "DOCUMENT HAS BEEN SAVED"
End Sub&lt;/PRE&gt;&lt;P&gt;It would run as long as you didn't cancel anything, but I wanted to set some more boundaries:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1) I want to look at the active document, identify its type, and tell the user that it should only be used in drawing documents&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) I want to rune the timer, basically the way it is written above, and save the previously identified document [ I want to be able to switch between multiple part/assembly documents while timer is running and save the drawing upon returning after the timer is done]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3) I want to ask the user if they would like to restart the timer, and do so with the same time limit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I've come up with so far:&lt;/P&gt;&lt;PRE&gt;Public Sub AUTOSAVE()

' Connect to a running instance of Inventor.
Dim invApp As Inventor.Application
invApp = System.Runtime.InteropServices.Marshal.GetActiveObject _
                                            ("Inventor.Application")
' Get the Documents collection.
Dim oDocs As Inventor.Documents
oDocs = invApp.Documents

' Get the Active part document.
Dim ThisDoc As Inventor.Documents
ThisDoc = invApp.ActiveDocument

If ThisDoc = Inventor.DrawingDocuments Then 'Check if user is in a drawing document
    GoTo 100
Else
    o = MsgBox("I would recommend only using the AUTOSAVE macro in drawing documents. Would you like to ignore this warning?", "Caution", MessageBoxButtons.YesNo)
        
    If o = vbYes Then
        MsgBox "Good Luck..."
        GoTo 100
    Else
        MsgBox "Good Choice!"
        GoTo 102
    End If
End If

100 'Requesting user input for timer duration

    i = InputBox("This timer has a limited range: 1-30(min).", "DRAFTING AUTOSAVE", i = 600) '10 minute default
    i = i * 60
    If i &amp;gt; 1800 Then
        MsgBox ("This timer has a limited range: 1-30(min), timer was set to 30min.")
        i = 1800
    ElseIf i &amp;lt; 60 Then
        MsgBox ("This timer has a limited range: 1-30(min), timer was set to 1min.")
        i = 60
    ElseIf i = vbCancel Then
    MsgBox "Timer was cancelled."
    GoTo 102
    End If

101 'Executing timer

    Dim SetTimer, Start, Finish, TotalTime
    SetTimer = i ' Settting duration.
       
        Start = Timer    ' Setting start time.
    Do While Timer &amp;lt; Start + SetTimer
        DoEvents    ' Yield to other processes.
    Loop
        Finish = Timer    ' Settting end time.
        TotalTime = Finish - Start    ' Calculating total time.
       
        ThisDoc.Save2 (True) 'Saving file at end of timer

'Asking user to run timer again

        r = MsgBox("The document has been saved sucessfully, would you like to restart the timer?", "DRAFTING AUTOSAVE", MessageBoxButtons.YesNo)
       
        If r = vbYes Then
        MsgBox "Timer will restart now."
        GoTo 101

        Else
        MsgBox "Timer is ended. Happy Modeling!"
        GoTo 102
        End If

102

End Sub&lt;/PRE&gt;&lt;P&gt;My issue is that the debugger won't get past the 4th line, where I set invApp = to the application.&amp;nbsp; I have tried using the ThisApplication designation but it doesn't like that either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone point me in the right direction?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 16:00:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297239#M89352</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2018-09-27T16:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297401#M89353</link>
      <description>&lt;PRE&gt;invApp = thisapplication&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 17:13:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297401#M89353</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-09-27T17:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297597#M89354</link>
      <description>&lt;P&gt;I've tried that, it does not fix the issue. I get this:&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="error report.JPG" style="width: 726px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/551249i9209033DE4F00480/image-size/large?v=v2&amp;amp;px=999" role="button" title="error report.JPG" alt="error report.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After i click OK, ThisApplication is highlighted&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 18:31:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297597#M89354</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2018-09-27T18:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297657#M89355</link>
      <description>&lt;P&gt;For VBA you need to "Set" every variable!!!&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;Dim AA as Application&lt;/P&gt;&lt;P&gt;set AA = Thisapplication&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 18:59:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297657#M89355</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-09-27T18:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297673#M89356</link>
      <description>&lt;P&gt;To my knowledge ThisApplication is a snippet made for use in iLogic, the VBA editor can't use the iLogic snippets, it has to use straight VBA code.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 19:03:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297673#M89356</guid>
      <dc:creator>philip1009</dc:creator>
      <dc:date>2018-09-27T19:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297747#M89358</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4898893"&gt;@J-Camper&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An short snippet and example of how to do it in VBA:&lt;/P&gt;&lt;PRE&gt;Public Sub AUTOSAVE()

' Connect to a running instance of Inventor.
Dim invApp As Inventor.Application
Set invApp = Thisapplication 'System.Runtime.InteropServices.Marshal.GetActiveObject _
                                            ("Inventor.Application")
' Get the Documents collection.
Dim oDocs As Inventor.Documents
Set oDocs = invApp.Documents

' Get the Active part document.
Dim ThisDoc As Inventor.Documents
Set ThisDoc = invApp.ActiveDocument&lt;BR /&gt;&lt;BR /&gt;Set APE as Integer&lt;BR /&gt;APE =1&lt;BR /&gt;Set NOTE as Boolean&lt;BR /&gt;NOTE = True&lt;BR /&gt;Set BANANAN as string&lt;BR /&gt;BANANA = "This Banana"&lt;/PRE&gt;&lt;P&gt;For I-logic&amp;nbsp; all the sets are not neccessary...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Autodesk Software:&lt;/STRONG&gt; Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018&lt;BR /&gt;&lt;STRONG&gt;Programming Skills:&lt;/STRONG&gt; Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/dimension-component-part-and-assembly/idi-p/7523011" target="_blank"&gt;Dimension Component!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/export-partlist-default-configuration/idc-p/7422221#M21416" target="_blank"&gt;Partlist Export!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/derived-part-and-assembly-copy-i-properties/idi-p/6349392" target="_blank"&gt;Derive I-properties!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/inventor-vault-prompts-settings-amp-vault-prompts-settings-via/idi-p/7641767" target="_blank"&gt;Vault Prompts Via API!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/vault-ideas/vault-professional-handbook-or-manual-to-be-provided/idi-p/7653669" target="_blank"&gt;Vault Handbook/Manual!&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/drawing-toggle-sheets/idi-p/7708757" target="_blank"&gt;Drawing Toggle Sheets!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/open-files-automatically-with-quot-defer-update-quot-on-read/idi-p/7762709" target="_blank"&gt;Vault Defer Update!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;! For administrative reasons, please mark a &lt;STRONG&gt;"Solution as solved"&lt;/STRONG&gt; when the issue is solved !&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 19:35:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297747#M89358</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-09-27T19:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297827#M89359</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/473476"&gt;@bradeneuropeArthur&lt;/a&gt;&lt;/P&gt;&lt;P&gt;That helps a lot, I didn't know about "Set".&amp;nbsp; Is there something I should Set my InputBox variable as?&amp;nbsp; It worked in the original snippet of code without Set, but I want to Develop proper coding grammar as I learn more.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I need to find a way to check the type of document that ThisDoc becomes after setting it to ActiveDocument.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure how to&amp;nbsp; DocumentDescriptorsEnumerator correctly, it doesn't like my Set line for ThisDocType:&lt;/P&gt;&lt;PRE&gt;' Get the type of active document
Dim ThisDocType As ObjectTypeEnum
Set ThisDocType = DocumentDescriptorsEnumerator.Type(ThisDoc)&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 20:08:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297827#M89359</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2018-09-27T20:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297910#M89360</link>
      <description>&lt;P&gt;Okay I got the check right,&lt;/P&gt;&lt;PRE&gt;' Get the Active part document.
Dim ThisDoc As Inventor.Document
Set ThisDoc = invApp.ActiveDocument

If ThisDoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then 'Check if user is in a drawing document
    GoTo 100
Else
    o = MsgBox("I would recommend only using the AUTOSAVE macro in drawing documents. Would you like to ignore this warning?", "Caution", MessageBoxButtons.YesNo)
        
    If o = vbYes Then
        MsgBox "Good Luck..."
        GoTo 100
    Else
        MsgBox "Good Choice!"
        GoTo 102
    End If
End If&lt;/PRE&gt;&lt;P&gt;but I think I need to "Dim" and "Set" my MsgBox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what to Dim o as though&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 20:42:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8297910#M89360</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2018-09-27T20:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8298286#M89364</link>
      <description>&lt;P&gt;Okay, I got this thing working without breaking.&amp;nbsp; I want to add a wait loop in case the timer runs out but I am working in a different document at the time, but ith keeps skipping through my loop:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;102 ' Waiting till part can be saved, then saving

' Get the Active part document.
Dim CurrDoc As Inventor.Document
Set CurrDoc = invApp.ActiveDocument

    Do While CurrDoc &amp;lt;&amp;gt; ThisDoc
        DoEvents    ' Yield to other processes.
        Set CurrDoc = invApp.ActiveDocument
    Loop

        ThisDoc.Save2 (True) 'Saving file at end of timer

'End 102 Waiting till part can be saved, then saving&lt;/PRE&gt;&lt;P&gt;it is not saving the file because i'm not active in ThisDoc when the timer runs out, and carries on to my restart MsgBox.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 00:27:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8298286#M89364</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2018-09-28T00:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8298899#M89379</link>
      <description>&lt;PRE&gt;' Get the Active part document.
Dim CurrDoc As Inventor.Document
&lt;FONT color="#ff0000" face="arial black,avant garde"&gt;Set CurrDoc = invApp.ActiveDocument&lt;/FONT&gt;

    Do While CurrDoc &amp;lt;&amp;gt; ThisDoc
        DoEvents    ' Yield to other processes.
        &lt;FONT color="#ff0000" face="arial black,avant garde"&gt;' This is already set before!!! Set CurrDoc = invApp.ActiveDocument&lt;/FONT&gt;
    Loop

        ThisDoc.Save2 (True) 'Saving file at end of timer

&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Sep 2018 09:14:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8298899#M89379</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-09-28T09:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8299479#M89391</link>
      <description>&lt;P&gt;Yeah the extra Set CurrDoc was only added because the macro wasn't staying in the loop while i was working in another document, and I thought it was because CurrDoc was set outside of the loop and it wouldn't keep checking what document was active.&amp;nbsp; I still don't have the macro waiting for me to switch back to ThisDoc, but it will save ThisDoc while I'm in another document so that works for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/473476"&gt;@bradeneuropeArthur&lt;/a&gt;I would like to thank you for telling me about using "Set".&amp;nbsp; That was my biggest hang up at the beginning.&amp;nbsp; If you can think of a better way to postpone the save until I'm back in ThisDoc, I would love to hear it.&amp;nbsp; I'm going to use it as is for now though.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 13:31:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8299479#M89391</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2018-09-28T13:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8303010#M89421</link>
      <description>&lt;P&gt;The Set statement isn't used in all assignments, but only when assigning an object to a variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want to take a step back and let you know that you're just heading towards a lot of disappointment with the program you're trying to write.&amp;nbsp; A VBA macro is not the right architecture to be building automatic save functionality on.&amp;nbsp; When you run a VBA macro, it takes over the Inventor user-interfaces.&amp;nbsp; Like all user-interfaces that I'm aware of, it is single threaded so there's only one thing going on at a time.&amp;nbsp; In your code you're trying to work around this by using the DoEvents statement.&amp;nbsp; What's happening here is that your macro has control over the UI and in the DoEvents statement is temporarily turning control back to Inventor so it can handle any pending events, and then control goes back to your macro.&amp;nbsp; This is very inefficient and I suspect there will be other problems.&amp;nbsp; I would suggest looking for something else as your introduction to learning the API.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Sep 2018 19:45:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8303010#M89421</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2018-09-30T19:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8305271#M89469</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;&lt;/P&gt;&lt;P&gt;You are right, I just started testing and have already run into glitchy issues with the autosave macro...&amp;nbsp; Have you ever tried to implement an Autosave feature into Inventor?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 18:05:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8305271#M89469</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2018-10-01T18:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8305514#M89483</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I did it in the past.&lt;/P&gt;&lt;P&gt;but build in macros don't have my preference.&lt;/P&gt;&lt;P&gt;Why are you asking, do you need an example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually this is not possible anymore without using an Add in:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/inv-2014-removes-support-for-vba-auto-run-macros/td-p/4313318" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/inv-2014-removes-support-for-vba-auto-run-macros/td-p/4313318&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Autodesk Software:&lt;/STRONG&gt; Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018&lt;BR /&gt;&lt;STRONG&gt;Programming Skills:&lt;/STRONG&gt; Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/dimension-component-part-and-assembly/idi-p/7523011" target="_blank"&gt;Dimension Component!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/export-partlist-default-configuration/idc-p/7422221#M21416" target="_blank"&gt;Partlist Export!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/derived-part-and-assembly-copy-i-properties/idi-p/6349392" target="_blank"&gt;Derive I-properties!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/inventor-vault-prompts-settings-amp-vault-prompts-settings-via/idi-p/7641767" target="_blank"&gt;Vault Prompts Via API!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/vault-ideas/vault-professional-handbook-or-manual-to-be-provided/idi-p/7653669" target="_blank"&gt;Vault Handbook/Manual!&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/drawing-toggle-sheets/idi-p/7708757" target="_blank"&gt;Drawing Toggle Sheets!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/open-files-automatically-with-quot-defer-update-quot-on-read/idi-p/7762709" target="_blank"&gt;Vault Defer Update!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;! For administrative reasons, please mark a &lt;STRONG&gt;"Solution as solved"&lt;/STRONG&gt; when the issue is solved !&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 19:55:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8305514#M89483</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-10-01T19:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8305804#M89498</link>
      <description>&lt;P&gt;Besides&amp;nbsp;the architecture issues that I mentioned earlier, creating an auto-save routing for Inventor is a bit tricky because of the save limitations in Inventor and that you don't want it to cause problems for the user.&amp;nbsp; One issue is that you can't save while a sketch is active.&amp;nbsp; I think there may also be some other cases where a save is blocked.&amp;nbsp; Another issue is with assemblies.&amp;nbsp; Do you only save whatever is currently active or do you look through all of the referenced parts and save any that have been modified?&amp;nbsp; And another issue is what is the timing of the save?&amp;nbsp; You don't just want it to be based on a time clock because when you start the save it will terminate whatever is currently going on.&amp;nbsp; So if the user is close to the end of executing a complicated command and they lose all of that because the auto-save terminates it, I don't think they'll be happy.&amp;nbsp; As you can see, it's not a simple problem.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 21:18:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8305804#M89498</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2018-10-01T21:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8305844#M89499</link>
      <description>&lt;P&gt;I never wanted to use the timer in parts/assemblies, just drawing files.&amp;nbsp; I have a bad habit of doing a lot in drawing files without saving, sometimes several hours in big drawings, and I've lost large amounts of time to a crash because of this.&amp;nbsp; I have been getting better about saving often in drawings and crashes aren't very frequent, especially as I learn how to use Inventor better.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know having an autosave feature would have saved my colleagues and myself a whole lot of re-do time, so I thought it would be a decent/useful project to get into Inventor's API.&amp;nbsp; I'm not going to use my macro because of the issues I've already seen, but I did learn a lot about API grammar so it wasn't a total waste of time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 21:47:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8305844#M89499</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2018-10-01T21:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with my first macro</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8306383#M89520</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;To my optic we should forget about the auto-macros in any environment, because of the issues related to them.&lt;/P&gt;&lt;P&gt;The only good way is start programming add ins based on the Save-events or other Events in inventor.&lt;/P&gt;&lt;P&gt;Only this way you are able to eliminate all the above or written problems....&lt;/P&gt;&lt;P&gt;If help is needed regarding this, I am willing to support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Autodesk Software:&lt;/STRONG&gt; Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018&lt;BR /&gt;&lt;STRONG&gt;Programming Skills:&lt;/STRONG&gt; Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/dimension-component-part-and-assembly/idi-p/7523011" target="_blank"&gt;Dimension Component!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/export-partlist-default-configuration/idc-p/7422221#M21416" target="_blank"&gt;Partlist Export!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/derived-part-and-assembly-copy-i-properties/idi-p/6349392" target="_blank"&gt;Derive I-properties!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/inventor-vault-prompts-settings-amp-vault-prompts-settings-via/idi-p/7641767" target="_blank"&gt;Vault Prompts Via API!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/vault-ideas/vault-professional-handbook-or-manual-to-be-provided/idi-p/7653669" target="_blank"&gt;Vault Handbook/Manual!&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/drawing-toggle-sheets/idi-p/7708757" target="_blank"&gt;Drawing Toggle Sheets!&lt;/A&gt; | &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/open-files-automatically-with-quot-defer-update-quot-on-read/idi-p/7762709" target="_blank"&gt;Vault Defer Update!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;! For administrative reasons, please mark a &lt;STRONG&gt;"Solution as solved"&lt;/STRONG&gt; when the issue is solved !&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 07:04:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-my-first-macro/m-p/8306383#M89520</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-10-02T07:04:19Z</dc:date>
    </item>
  </channel>
</rss>

