🚀 Stop Hunting for Drawings: Open 2D CAD Files Directly from Inventor Assemblies

 As engineers, we often need to cross-check our 3D models against the 2D production drawings to ensure everything is in sync.

The traditional way is a time-killer:

  1. Open the folder.

  2. Search for the Part Number.

  3. Check the revision.

  4. Finally, open the DWG.

If you are doing this 20-30 times a day, you are losing valuable design time. Today, I’m sharing a free iLogic tool that lets you open the corresponding DWG file with just one click, even while you are working inside a massive assembly (.iam).

Key Features:

  • Instant Comparison: Quickly verify 3D vs 2D without leaving your workspace.

  • Assembly Integration: Just select a part in your assembly and run the script—it finds the drawing for you.

  • Revision Control: It automatically detects the "Revision Number" and looks for the correct file version (e.g., Part-01.dwg).

  • Workflow Efficiency: Eliminates manual navigation in Windows Explorer.



Dim oDoc As Document = ThisDoc.Document
Dim partFileName As String = ""
Dim revision As String = ""
If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
	partFileName = System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName)
	oldDoc = ThisApplication.Documents.Open(oDoc.FullFileName, False)
	Dim propertySet As PropertySet = oldDoc.PropertySets.Item("Inventor Summary Information")
	revision = propertySet.Item("Revision Number").Value.ToString()
ElseIf oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
	If oDoc.SelectSet.Count <> 1 :
		MessageBox.Show("File Assembly chỉ được chọn 1 part")
		Return
	End if
	Dim oCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
	oldDoc = ThisApplication.Documents.Open(oDoc.SelectSet.Item(1).Definition.Document.FullFileName, False)
	Dim propertySet As PropertySet = oldDoc.PropertySets.Item("Inventor Summary Information")
	revision = propertySet.Item("Revision Number").Value.ToString()
	partFileName = System.IO.Path.GetFileNameWithoutExtension(oDoc.SelectSet.Item(1).Definition.Document.FullFileName)
End If
Dim extension As String = ""
Try
	Dim intRevision As Integer = Int32.Parse(revision)
	If intRevision > 0 :
		extension = "-" & revision 
	End If
Catch
	
End Try
Dim dwgFilePath As String = "H:\Internal_share\CAD_Drawing\" & partFileName & extension & ".dwg"

If System.IO.File.Exists(dwgFilePath) Then
	System.Diagnostics.Process.Start(dwgFilePath)
Else
	MessageBox.Show("DWG file not found. File path checked: " & dwgFilePath, "Error occurred!")
End If


#AutodeskInventor #iLogic #VBNET #CADAutomation #InventorTips #MechanicalEngineering #DesignWorkflow #OpenDWG

Thảo luận về bài viết:

Comments

Popular posts from this blog

[Inventor iLogic] Stop Wasting Time! Replace File v1.3: The Ultimate Solution for Component Replacement & IDW Auto-Updates

[Inventor iLogic] Stop Wasting Time! Replace File v1.2: Xử lý triệt để bài toán thay thế & Update bản vẽ IDW