iLogic Quick Tip: Launch Drawing From Model

I recently saw a question, where an Inventor user wanted to open a drawing from a model, using iLogic. The code below will achieve this, the trick here is that your model (.ipt or .iam) needs to be saved first, so that it has a file name for iLogic to use.

Here’s the code, it first looks for a DWG file, if it can’t find one, it trys to open an IDW file. If ther is no drawing file available, it returns a message box.

Try
	oDWG = ThisDoc.FileName(False) & ".dwg"
	ThisDoc.Launch(oDWG)
Catch
	GoTo IDW
End Try

Return

IDW :
Try
	oDWG = ThisDoc.FileName(False) & ".idw"
	ThisDoc.Launch(oDWG)
Catch
	MessageBox.Show("No Drawing Found", "@ClintBrown3D")
End Try