<?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 Check In Saved Copy of Drawing in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9148667#M103129</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to find out how to check in a file that I have already saved a different copy of with a different name than the original. Fo example, original model may be called '0123456.ipt' but once my rule runs, the machine drawing becomes '0123456 - 50mm.ipt' etc. I would like to be able to check in this machine drawing version as I am saving it if possible. I've already tried to find the information on here and the greater Internet and found the info here very useful (&lt;A href="https://forums.autodesk.com/t5/inventor-forum/ilogic-check-in-drawing-into-vault/td-p/4735987" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-forum/ilogic-check-in-drawing-into-vault/td-p/4735987&lt;/A&gt;) but it checks in my original file and I'm not good enough in Inventor to wriggle my way around this one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated.&lt;/P&gt;&lt;PRE&gt;Dim modelname As String
Dim odoc As Document

'saved = False

iLogicForm.Show("Save Drawing")

modelname = iProperties.Value("Summary", "Title")

If saved = True Then
	ThisDoc.Document.saveasinventordwg("[MACHINE DRAWING FILEPATH]" &amp;amp; modelname &amp;amp; ".dwg", True)
	
	'oPath = ThisDoc.Path
	oFileName = ThisDoc.FileName(False) 'without extension
	oRevNum = iProperties.Value("Project", "Revision Number")
	oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	oDocument = ThisApplication.ActiveDocument
	oContext = ThisApplication.TransientObjects.CreateTranslationContext
	oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
	oOptions = ThisApplication.TransientObjects.CreateNameValueMap
	oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	'oFolder = "[FILEPATH]"

	'If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
	oOptions.Value("All_Color_AS_Black") = 1
	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 = "[PDF DRAWING FILEPATH]"

	'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

	 'Set the PDF target file name
	oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; modelname &amp;amp; ".pdf"
	
	'Publish document
	oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
	
	ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)
	
Else
	Logger.Debug("saved?: " &amp;amp; saved)
	Exit Sub

End If

saved = False

&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Nov 2019 11:08:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-15T11:08:45Z</dc:date>
    <item>
      <title>Check In Saved Copy of Drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9148667#M103129</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to find out how to check in a file that I have already saved a different copy of with a different name than the original. Fo example, original model may be called '0123456.ipt' but once my rule runs, the machine drawing becomes '0123456 - 50mm.ipt' etc. I would like to be able to check in this machine drawing version as I am saving it if possible. I've already tried to find the information on here and the greater Internet and found the info here very useful (&lt;A href="https://forums.autodesk.com/t5/inventor-forum/ilogic-check-in-drawing-into-vault/td-p/4735987" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-forum/ilogic-check-in-drawing-into-vault/td-p/4735987&lt;/A&gt;) but it checks in my original file and I'm not good enough in Inventor to wriggle my way around this one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated.&lt;/P&gt;&lt;PRE&gt;Dim modelname As String
Dim odoc As Document

'saved = False

iLogicForm.Show("Save Drawing")

modelname = iProperties.Value("Summary", "Title")

If saved = True Then
	ThisDoc.Document.saveasinventordwg("[MACHINE DRAWING FILEPATH]" &amp;amp; modelname &amp;amp; ".dwg", True)
	
	'oPath = ThisDoc.Path
	oFileName = ThisDoc.FileName(False) 'without extension
	oRevNum = iProperties.Value("Project", "Revision Number")
	oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	oDocument = ThisApplication.ActiveDocument
	oContext = ThisApplication.TransientObjects.CreateTranslationContext
	oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
	oOptions = ThisApplication.TransientObjects.CreateNameValueMap
	oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	'oFolder = "[FILEPATH]"

	'If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
	oOptions.Value("All_Color_AS_Black") = 1
	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 = "[PDF DRAWING FILEPATH]"

	'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

	 'Set the PDF target file name
	oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; modelname &amp;amp; ".pdf"
	
	'Publish document
	oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
	
	ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)
	
Else
	Logger.Debug("saved?: " &amp;amp; saved)
	Exit Sub

End If

saved = False

&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Nov 2019 11:08:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9148667#M103129</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-15T11:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Check In Saved Copy of Drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9148971#M103135</link>
      <description>&lt;P&gt;For additional reference, my drawing template is the one that is being altered (called 'drawing_template'). It changes names during the saving process to the name of the model and the the distinguisher (i.e. '0123456 - 50mm') but when I check it in to Vault via iLogic, it is drawing_template that is being checked in and not 0123456 - 50mm. I'm not sure on how to make sure the new file is the one being affected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 13:51:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9148971#M103135</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-15T13:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Check In Saved Copy of Drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9149233#M103144</link>
      <description>&lt;P&gt;Hi, i have no vault at home there for this is my best guess without being able to check it for you. The checkin command that you are using will always checkin the active file. afther you save the new file it is not opend therfore it will be checked in. the solotion is then to open the file before using the checkin command. like this. (i added the red line).&lt;/P&gt;&lt;PRE&gt;Dim modelname As String
Dim odoc As Document

'saved = False

iLogicForm.Show("Save Drawing")

modelname = iProperties.Value("Summary", "Title")

If saved = True Then
	ThisDoc.Document.saveasinventordwg("[MACHINE DRAWING FILEPATH]" &amp;amp; modelname &amp;amp; ".dwg", True)
	
	'oPath = ThisDoc.Path
	oFileName = ThisDoc.FileName(False) 'without extension
	oRevNum = iProperties.Value("Project", "Revision Number")
	oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	oDocument = ThisApplication.ActiveDocument
	oContext = ThisApplication.TransientObjects.CreateTranslationContext
	oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
	oOptions = ThisApplication.TransientObjects.CreateNameValueMap
	oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	'oFolder = "[FILEPATH]"

	'If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
	oOptions.Value("All_Color_AS_Black") = 1
	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 = "[PDF DRAWING FILEPATH]"

	'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

	 'Set the PDF target file name
	oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; modelname &amp;amp; ".pdf"
	
	'Publish document
	oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
	&lt;FONT color="#FF0000"&gt;ThisApplication.Documents.Open("[MACHINE DRAWING FILEPATH]" &amp;amp; modelname &amp;amp; ".dwg")&lt;/FONT&gt;
	ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)
	
Else
	Logger.Debug("saved?: " &amp;amp; saved)
	Exit Sub

End If

saved = False&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Nov 2019 15:37:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9149233#M103144</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2019-11-15T15:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Check In Saved Copy of Drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9149436#M103146</link>
      <description>&lt;P&gt;This is great&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;! Looks like this has totally resolved it. Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 16:50:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-in-saved-copy-of-drawing/m-p/9149436#M103146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-15T16:50:55Z</dc:date>
    </item>
  </channel>
</rss>

