Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Assembly Tiers CATIA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WZL-IQS-Public
Automated Assembly Sequence Planning
Assembly Tiers CATIA
Commits
221f0bd4
Commit
221f0bd4
authored
4 years ago
by
Mikhail Polikarpov
Browse files
Options
Downloads
Patches
Plain Diff
Export BB volumes to Excel
parent
878b7ea6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CatiaNetTest/AssemblyTiers2.vb
+30
-0
30 additions, 0 deletions
CatiaNetTest/AssemblyTiers2.vb
with
30 additions
and
0 deletions
CatiaNetTest/AssemblyTiers2.vb
+
30
−
0
View file @
221f0bd4
...
@@ -188,6 +188,9 @@ Public Class AssemblyTiers2
...
@@ -188,6 +188,9 @@ Public Class AssemblyTiers2
MsgBox
(
"Bounding box calculation took "
&
CStr
(
BBSecondsElapsed
)
&
" seconds"
)
MsgBox
(
"Bounding box calculation took "
&
CStr
(
BBSecondsElapsed
)
&
" seconds"
)
Debug
.
Print
(
"Number of faces in assembly: "
&
CStr
(
intNumFaces
))
Debug
.
Print
(
"Number of faces in assembly: "
&
CStr
(
intNumFaces
))
'Export BB volumes of parts to Excel
ExportBBVolumes
()
'Collision parameters
'Collision parameters
If
bAutomaticStep
Then
If
bAutomaticStep
Then
Dim
dGeomMean
As
Double
Dim
dGeomMean
As
Double
...
@@ -1875,6 +1878,33 @@ Finish:
...
@@ -1875,6 +1878,33 @@ Finish:
Return
True
Return
True
End
Function
End
Function
Sub
ExportBBVolumes
()
'Use Excel
Dim
objExcel
As
Microsoft
.
Office
.
Interop
.
Excel
.
Application
objExcel
=
CreateObject
(
"Excel.Application"
)
objExcel
.
Visible
=
True
objExcel
.
Workbooks
.
Add
()
objExcel
.
ActiveWorkbook
.
Sheets
.
Add
.
Name
=
"BB Volumes"
Dim
objSheet1
As
Object
objSheet1
=
objExcel
.
ActiveWorkbook
.
Worksheets
(
1
)
'Write data
objSheet1
.
Cells
(
1
,
1
).
Value
=
"Product"
objSheet1
.
Cells
(
1
,
2
).
Value
=
"BB volume"
For
int_i
=
0
To
cRelevantProducts
.
Count
-
1
Dim
dPartBBVolume
As
Double
dPartBBVolume
=
(
aPartBBGlob
(
int_i
,
0
)
-
aPartBBGlob
(
int_i
,
1
))
*
(
aPartBBGlob
(
int_i
,
2
)
-
aPartBBGlob
(
int_i
,
3
))
*
(
aPartBBGlob
(
int_i
,
4
)
-
aPartBBGlob
(
int_i
,
5
))
objSheet1
.
Cells
(
int_i
+
2
,
1
).
Value
=
cRelevantProducts
.
Item
(
int_i
).
Name
objSheet1
.
Cells
(
int_i
+
2
,
2
).
Value
=
dPartBBVolume
Next
int_i
'Save and close excel workbook
Dim
xlsFileName
As
String
=
CATIA
.
ActiveDocument
.
Name
objExcel
.
ActiveWorkbook
.
SaveAs
(
Filename
:
=
xlsPath
&
xlsFileName
&
"_BB Volumes.xlsx"
)
objExcel
.
ActiveWorkbook
.
Close
(
SaveChanges
:
=
True
)
'close the excel application
objExcel
.
Quit
()
ReleaseObject
(
objExcel
)
End
Sub
Private
Sub
ReleaseObject
(
ByVal
obj
As
Object
)
Private
Sub
ReleaseObject
(
ByVal
obj
As
Object
)
Try
Try
Dim
intRel
As
Integer
=
0
Dim
intRel
As
Integer
=
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment