Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: bradeneuropeArthur

You're right, thank you. The bold section is where the file copy is created, saved and checked in to Vault. When it is created, it goes through an Event Triggered piece of code which starts the sketch process for a base drawing. To either stop the base drawing process at this point or limit it to one go or something like that is what I'm after. Thank you.

 

Dim modelname As String
Dim odoc As Document


iLogicForm.Show("Save Drawing")

modelname = iProperties.Value("Summary", "Title")

If saved = True Then
	ThisDoc.Document.saveasinventordwg("[MACHINE DRAWING FIEPATH]" & modelname & ".dwg", True)
	
	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

	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

	'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 & "\" & modelname & ".pdf"
	
	'Publish document
	oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
	
	thisapplication.Documents.Open("[MACHINE DRAWING FILEPATH]" & modelname & ".dwg")
	ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)

Else
	Logger.Debug("saved?: " & saved)
	Exit Sub

End If

saved = False