diff --git a/CatiaNetTest/AssemblyTiers2.vb b/CatiaNetTest/AssemblyTiers2.vb index 0a317b53774e242bd9b2982423dd90f7ca947c31..f41fb6a6066af329a2eebc19e10e10d4162bbbea 100644 --- a/CatiaNetTest/AssemblyTiers2.vb +++ b/CatiaNetTest/AssemblyTiers2.vb @@ -46,6 +46,12 @@ Public Class AssemblyTiers2 Public liaisonMatrix(,) As Integer Public sChosenDirection As String Public oList As Object + Public t_bounding_box As Double + Public t_assembly_tiers As Double + Public selected_base_component As String + Public assembly_dimension_x As Double + Public assembly_dimension_y As Double + Public assembly_dimension_z As Double Public CATIA As INFITF.Application @@ -93,6 +99,7 @@ Public Class AssemblyTiers2 For i = 1 To baseSel.Count cBaseProducts.Add(baseSel.Item(i).LeafProduct) Debug.Print("Added base component: " & baseSel.Item(i).LeafProduct.Name) + selected_base_component = baseSel.Item(i).LeafProduct.Name Next oSel.Clear() @@ -189,6 +196,8 @@ Public Class AssemblyTiers2 BBMillisecondsElapsed = (Now - BBStartTime).TotalMilliseconds Dim BBSecondsElapsed As Double BBSecondsElapsed = Math.Round(BBMillisecondsElapsed / 1000.0, 2) + t_bounding_box = BBSecondsElapsed + MsgBox("Bounding box calculation took " & CStr(BBSecondsElapsed) & " seconds") Debug.Print("Number of faces in assembly: " & CStr(intNumFaces)) @@ -209,6 +218,11 @@ Public Class AssemblyTiers2 "Y = " & aAssemblyBoundaries(2) - aAssemblyBoundaries(3) & vbNewLine & "Z = " & aAssemblyBoundaries(4) - aAssemblyBoundaries(5)) + assembly_dimension_x = aAssemblyBoundaries(0) - aAssemblyBoundaries(1) + assembly_dimension_y = aAssemblyBoundaries(2) - aAssemblyBoundaries(3) + assembly_dimension_z = aAssemblyBoundaries(4) - aAssemblyBoundaries(5) + + 'After the aAssemblyBoundaries and aPartBBGlob are calculated, define aRemovalDistances For i = 0 To cRelevantProducts.Count - 1 aRemovalDistances(i, 0) = aAssemblyBoundaries(0) - aPartBBGlob(i, 1) @@ -600,6 +614,8 @@ exitCD: Dim MillisecondsElapsed As Double MillisecondsElapsed = (Now - AssemblyTiersStartTime).TotalMilliseconds SecondsElapsed = Math.Round(MillisecondsElapsed / 1000.0, 2) + t_assembly_tiers = SecondsElapsed + MsgBox("Collision detection algorithm finished execution after " & CStr(SecondsElapsed) & " seconds") 'Return products to their initial positions, activate them @@ -767,7 +783,75 @@ exitCD: objExcel.Quit() ReleaseObject(objExcel) + SaveMetaDataToExcel_AT() + + + End Sub + + Sub SaveMetaDataToExcel_AT() + 'Use Excel + Dim oExcel As Microsoft.Office.Interop.Excel.Application + oExcel = CreateObject("Excel.Application") + oExcel.Visible = True + oExcel.Workbooks.Add() + oExcel.ActiveWorkbook.Sheets.Add.Name = "meta_data_at" + Dim objSheet_m As Object + objSheet_m = oExcel.ActiveWorkbook.Worksheets(1) + + 'Output Metadata + + objSheet_m.Cells(1, 1).Value = "n_parts" + objSheet_m.Cells(1, 2).Value = cAllProducts.Count + + objSheet_m.Cells(2, 1).Value = "n_geometrical faces" + objSheet_m.Cells(2, 2).Value = intNumFaces + + objSheet_m.Cells(3, 1).Value = "assembly_dimension_x" + objSheet_m.Cells(3, 2).Value = assembly_dimension_x + + objSheet_m.Cells(4, 1).Value = "assembly_dimension_y" + objSheet_m.Cells(4, 2).Value = assembly_dimension_y + + objSheet_m.Cells(5, 1).Value = "assembly_dimension_z" + objSheet_m.Cells(5, 2).Value = assembly_dimension_z + + objSheet_m.Cells(6, 1).Value = "bb_projection_check" + objSheet_m.Cells(6, 2).Value = bBoundingBoxProjectionCheck + + objSheet_m.Cells(7, 1).Value = "bounding_box_code_type" + objSheet_m.Cells(7, 2).Value = iBoundingBoxCode + + objSheet_m.Cells(8, 1).Value = "connectivity_check" + objSheet_m.Cells(8, 2).Value = bConnectivityCheck + + objSheet_m.Cells(9, 1).Value = "step_size" + objSheet_m.Cells(9, 2).Value = intStep + + objSheet_m.Cells(10, 1).Value = "step_size_sensitivity" + objSheet_m.Cells(10, 2).Value = dCollSens + + objSheet_m.Cells(11, 1).Value = "num_collision_axes" + objSheet_m.Cells(11, 2).Value = intJ + + objSheet_m.Cells(12, 1).Value = "selected_base_component" + objSheet_m.Cells(12, 2).Value = selected_base_component + + objSheet_m.Cells(13, 1).Value = "t_bounding_box" + objSheet_m.Cells(13, 2).Value = t_bounding_box + + objSheet_m.Cells(14, 1).Value = "t_assembly_tiers_method" + objSheet_m.Cells(14, 2).Value = t_assembly_tiers + + + + 'Save and close excel workbook + oExcel.ActiveWorkbook.SaveAs(Filename:=xlsPath & xlsFileName & "_meta_data_at.xlsx") + oExcel.ActiveWorkbook.Close(SaveChanges:=True) + 'close the excel application + oExcel.Quit() + ReleaseObject(oExcel) End Sub + Sub ExtractProducts(oCurrentProduct As Product) Dim oCurrentTreeNode As Product diff --git a/CatiaNetTest/bin/Debug/CatiaNetTest.exe b/CatiaNetTest/bin/Debug/CatiaNetTest.exe index 47b669723a7c10565937131e59d987e6ac6eec2a..34e6f534b6a94519b46a81bf76583c43a1d5e427 100644 Binary files a/CatiaNetTest/bin/Debug/CatiaNetTest.exe and b/CatiaNetTest/bin/Debug/CatiaNetTest.exe differ diff --git a/CatiaNetTest/bin/Debug/CatiaNetTest.pdb b/CatiaNetTest/bin/Debug/CatiaNetTest.pdb index 4cf48b9dce3fd65816e012e882733412906d00a5..516eddfed28da258cbb86aa02013690485d4f3c1 100644 Binary files a/CatiaNetTest/bin/Debug/CatiaNetTest.pdb and b/CatiaNetTest/bin/Debug/CatiaNetTest.pdb differ diff --git a/CatiaNetTest/obj/Debug/CatiaNetTest.exe b/CatiaNetTest/obj/Debug/CatiaNetTest.exe index 47b669723a7c10565937131e59d987e6ac6eec2a..34e6f534b6a94519b46a81bf76583c43a1d5e427 100644 Binary files a/CatiaNetTest/obj/Debug/CatiaNetTest.exe and b/CatiaNetTest/obj/Debug/CatiaNetTest.exe differ diff --git a/CatiaNetTest/obj/Debug/CatiaNetTest.pdb b/CatiaNetTest/obj/Debug/CatiaNetTest.pdb index 4cf48b9dce3fd65816e012e882733412906d00a5..516eddfed28da258cbb86aa02013690485d4f3c1 100644 Binary files a/CatiaNetTest/obj/Debug/CatiaNetTest.pdb and b/CatiaNetTest/obj/Debug/CatiaNetTest.pdb differ