Skip to content
Snippets Groups Projects
Commit c2e083f8 authored by Sören Münker's avatar Sören Münker
Browse files

meta data script for assembly tiers method added.

parent e5c0e6b1
Branches
No related tags found
Loading
......@@ -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
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment