 |
This task shows how to create a
user catalog for parametric sections.
You can create user catalogs in three different ways:
- Using the Catalog Editor with one
sketch corresponding to one family and linked to one design table.
- With a Part Family in Batch Mode
with one sketch corresponding to one family and linked to one design
table.
- In Batch Mode where one sketch is used
for several families and design tables are not linked to the sketch.
These catalogs are built in the same way as the sample catalogs
supplied with the product.
|
 |
Sample CatScript documents are provided to illustrate
the batch mode and will be mentioned below at the appropriate step in
the task. They are to be found in the online documentation filetree in
the common functionalities sample folder, cfysm/samples. |
|
Creating a Catalog using the Catalog
Editor
This first task introduces the Catalog Editor workbench which
provides interactive commands to create your own catalogs. |
 |
1. |
Make a USER directory with
the same name as your catalog and sub-directories for sketches and
design tables:
- USER/Sketches
- USER/DesignTables.
|
|
2. |
Sketch the profiles for
your user sections and store in the USER/Sketches directory.
Standard sketches of parametric sections (I, U, L, T, double U,
double L, bulb and tube shapes) supplied with the product are located in
the directory
install_folder/startup/components/StructuralCatalogs/Sketchs. |
|
3. |
Create design tables, naming
the header in the first column PartNumber. Note: You can create design
tables in two ways:
- Independently of sketches, in which case you must link tables to
sketches (ensuring that design table column headers correspond to
sketch parameters).
- Based on the sketches, in which case no linking is necessary.
Design tables contain the geometric parameters used to generate the
section. |
|
|
 |
|
4. |
Use the Catalog Editor to
create your catalog:
- From the Start menu, select Infrastructure ->Catalog Editor
to open the Catalog Editor workbench.
- Use the Add Part Family
icon for Structure Design catalogs.
For more information, see Creating a Catalog using the Catalog Editor
in the Infrastructure User's Guide. |
|
Creating a Catalog with a Part
Family in Batch Mode
|
 |
1. |
Make a USER directory with
the same name as your catalog and sub-directories for sketches, design
tables and CSV files:
- USER/Sketches
- USER/DesignTables
- USER/CSVFiles
- USER/VBScript.
|
|
2. |
Sketch the profiles for
your user sections and store in the USER/Sketches directory.
Standard sketches of parametric sections (I, U, L, T, double U,
double L, bulb and tube shapes) supplied with the product are located in
the directory
install_folder/startup/components/StructuralCatalogs/Sketchs. |
|
3. |
Create design tables, naming
the header in the first column PartNumber. Note: You can create design
tables in two ways:
- Independently of sketches, in which case you must link tables to
sketches (ensuring that design table column headers correspond to
sketch parameters).
- Based on the sketches, in which case no linking is necessary.
Design tables contain the geometric parameters used to generate the
section. |
|
|
 |
|
4. |
Create
a CSV-type file for Chapters.
CSV files map family names to appropriate family catalogs.
Chapters correspond to the first level in a catalog and provide a way
of classifying other chapters or families. |
|
|
Typical CSV file:
CHAPTER;DIN;I_SectionCatalogDIN;
Keywords;Family;
Types;String;
;Quadrat_Hohlprofile;e: \users \jcm \StructuralCatalogs \USER \Quadrat_Hohlprofile.catalog
;Rechteck_Hohlprofile;e: \users \jcm \StructuralCatalogs \USER \Rechteck_Hohlprofile.catalog |
|
5. |
Create ENDCHAPTER and
CHAPTER CATScripts. Sample CATScripts are given below. They are to be
found in the online documentation filetree in the common functionalities
sample folder, cfysm/samples. |
|
|
ENDCHAPTER
- Open the file USER_EndChapterswithPartFamily.CATScript. In our
example, the content looks like this:
|
|
|
'// COPYRIGHT DASSAULT SYSTEMES
1999
'//============================================================================
'//
'// Language="VBSCRIPT"
'// To build catalog from a parametric part
'//
'//============================================================================
'// Major interface used:
'//
'// interface VB Name Remarks
'// ----------- ------------ --------------
'// CATIACatalogDocument CatalogDocument create catalog
'//
'//============================================================================
Option Explicit
'******************************************************************************
' GLOBAL variable declarations section
'******************************************************************************
Dim strGInputPath
Dim strGOutputPath
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'// User customizable sections
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Const NBEndChapter = 2
Dim strArrayEndChapter (2)
Dim strArrayModelFile (2)
Dim strArrayCatalogFile (2)
'------------------------------------------------------------------------------
Sub InitEndChapterArray ()
'------------------------------------------------------------------------------
' Name of the description displayed in the catalog browser
'------------------------------------------------------------------------------
strArrayEndChapter(1) = "Tees"
strArrayEndChapter(2) = "Equal Angles"
'------------------------------------------------------------------------------
' Name of the .CATPart defining the sketches
'------------------------------------------------------------------------------
strArrayModelFile(1) = "TShape"
strArrayModelFile(2) = "LShape"
'------------------------------------------------------------------------------
' Name of the generated files .catalog used in the USER.CATScript
'------------------------------------------------------------------------------
strArrayCatalogFile(1) = "USER_Tees"
strArrayCatalogFile(2) = "USER_Equal_Angles"
End Sub
'------------------------------------------------------------------------------
Sub GetPath ()
'------------------------------------------------------------------------------
strGInputPath = InputBox("Path of the models directory:", _
"Input path for model files", _
"e: \users \jcm \USER \Sketches \")
strGOutputPath = InputBox("Path of the catalog output
directory:", _
"Output path for Catalogs", _
"e: \users \jcm \USER \")
End Sub '
'------------------------------------------------------------------------------
Sub CATMain()
'------------------------------------------------------------------------------
Dim objCatalogDoc As Document
Dim intK As Integer
Dim strChapterName As String
Dim strModelName As String
Dim strCatalogName As String
'
InitEndChapterArray
'
GetPath
'
On Error Resume Next
For intK = 1 to NBEndChapter
strModelName = strGInputPath & strArrayModelFile (intK) &
".CATPart"
strChapterName = strArrayEndChapter (intK)
strCatalogName = strGOutputPath & strArrayCatalogFile (intK) &
".catalog"
Set objCatalogDoc = CATIA.Documents.Add("CatalogDocument")
' Calls the method on Catalog to create inside the catalog document
' a chapter from the Design Table
objCatalogDoc.CreateChapterFromDesignTable strChapterName ,
strModelName
' Saves the catalog document
objCatalogDoc.SaveAs strCatalogName
' Closes the catalog document
objCatalogDoc.Close
Next 'For intK
MsgBox "Press OK to quit", 0, "CATALOG CREATION COMPLETED"
End Sub '///////////////////////////////////////////////
CATMain
|
|
|
- If you want to use it, copy it and change
the User customizable sections to adapt them to your environment, or
copy a sample CATScript from the one of the standard catalogs supplied
with the product and change it.
|
|
|
CHAPTER
- Open the file USER_Chapter.CATScript. In our example, the content
looks like this:
|
|
|
'// COPYRIGHT DASSAULT SYSTEMES
1999
'//============================================================================
'//
'// Language="VBSCRIPT"
'// To build catalog
'//
'//============================================================================
'// Major interface used:
'//
'// interface VB Name Remarks
'// ----------- ------------ --------------
'// CATIACatalogDocument CatalogDocument create catalog
'//
'//============================================================================
Option Explicit
'******************************************************************************
' GLOBAL variable declarations section
'******************************************************************************
Dim strGInputPath
Dim strGOutputPath
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'// User customizable sections
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Const NBGCSVFile = 1
Dim strArrayGCSVFile (1)
'------------------------------------------------------------------------------
Sub InitCSVFileArray ()
'------------------------------------------------------------------------------
strArrayGCSVFile(1) = "USER"
End Sub '///////////////////////////////////////////////
InitCSVFileArray
'------------------------------------------------------------------------------
Sub GetPath ()
'------------------------------------------------------------------------------
strGInputPath = InputBox("Path of the catalog input
directory:", _
"Input path for CSV files", _
"e: \users \jcm \USER \CsvFiles \")
strGOutputPath = InputBox("Path of the catalog output
directory:", _
"Output path for Catalogs", _
"e: \users \jcm \USER \")
End Sub '///////////////////////////////////////////////
GetPath
'------------------------------------------------------------------------------
Sub CATMain ()
'------------------------------------------------------------------------------
Dim objCatalogDoc As Document
Dim intK As Integer
Dim strCSVFile
Dim strCatalogFile
InitCSVFileArray
GetPath
On Error Resume Next
For intK = 1 to NBGCSVFile
strCSVFile = strGInputPath & strArrayGCSVFile (intK) &
".csv"
strCatalogFile = strGOutputPath & strArrayGCSVFile (intK) &
".catalog"
Set objCatalogDoc = CATIA.Documents.Add("CatalogDocument")
'---------- Generate catalog
objCatalogDoc.CreateCatalogFromcsv strCSVFile,strCatalogFile
Next 'For intK
MsgBox "Press OK to quit", 0, "CATALOG CREATION COMPLETED"
End Sub '///////////////////////////////////////////////
CATMain
|
|
|
- If you want to use it, copy it and change
the User customizable sections to adapt them to your environment, or
copy a sample CATScript from the one of the standard catalogs supplied
with the product and change it.
|
|
6. |
You are now ready to run the
batch operation: |
|
|
- Start a Version 5 session
- Select Tools ->Macro ->Macros...
- In the Macro dialog box, set Macro in to External File
- Select the appropriate CATScript, then click Run.
It is important to run the CATScript generating the families (END
CHAPTERS) before the one generating the chapter (CHAPTER) since the
chapter references the families. |
|
Creating a Catalog in Batch Mode
|
 |
1. |
Make a USER directory with
the same name as your catalog and sub-directories for sketches, design
tables and CSV files:
- USER/Sketches
- USER/DesignTables (this sub-directory must be named DesignTables)
- USER/CSVFiles
- USER/VBScript.
|
|
2. |
Sketch the profiles for
your user sections and store in the USER/Sketches directory.
Standard sketches of parametric sections (I, U, L, T, double U,
double L, bulb and tube shapes) supplied with the product are located in
the directory
install_folder/startup/components/StructuralCatalogs/Sketchs. |
|
3. |
Create design tables.
Note: Do not link design tables to sketches.
Design tables contain the geometric parameters used to generate the
section. |
|
4. |
Create
CSV-type files for End Chapters and Chapters.
CSV files map section names to appropriate parametric sketches. |
|
|
END CHAPTER Conventions
End chapters correspond to catalog families. A family is a set of
components.
For example, ENDCHAPTER: Name;Icon;DesignTable; |
|
|
- If the design table is not linked to a sketch, the name of the
design table must be the last parameter in the first line starting
ENDCHAPTER.
- The first keyword must be Section
- The full path name of documents must be given.
|
|
|
Typical CSV file:
ENDCHAPTER;HEA;I_SectionStructureI;OTUA_HEA;
Keywords;Section;
Types;String;
HEA100;HEA100;e: \users \jcm \StructuralCatalogs \Sketches \IShape.CATPart
HEA120;HEA120;e: \users \jcm \StructuralCatalogs \Sketches \IShape.CATPart
HEA140;HEA140;e: \users \jcm \StructuralCatalogs \Sketches \IShape.CATPart
|
|
|
CHAPTER Conventions
Chapters correspond to the first level in a catalog and provide a way
of classifying other chapters or families. |
|
|
Typical CSV file:
CHAPTER;DIN;I_SectionCatalogDIN;
Keywords;Family;
Types;String;
;Quadrat_Hohlprofile;e: \users \jcm \StructuralCatalogs \USER \Quadrat_Hohlprofile.catalog
;Rechteck_Hohlprofile;e: \users \jcm \StructuralCatalogs \USER \Rechteck_Hohlprofile.catalog |
|
5. |
Create ENDCHAPTER and
CHAPTER CATScripts. Sample CATScripts are given below. They are to be
found in the online documentation filetree in the common functionalities
sample folder, cfysm/samples. |
|
|
ENDCHAPTER
- Open the file USER_EndChaptersStandard.CATScript. In our example,
the content looks like this:
|
|
|
'// COPYRIGHT DASSAULT SYSTEMES
1999
'//============================================================================
'//
'// Language="VBSCRIPT"
'// To build catalog
'//
'//============================================================================
'// Major interface used:
'//
'// interface VB Name Remarks
'// ----------- ------------ --------------
'// CATIACatalogDocument CatalogDocument create catalog
'//
'//============================================================================
Option Explicit
'******************************************************************************
' GLOBAL variable declarations section
'******************************************************************************
Dim strGInputPath
Dim strGOutputPath
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'// User customizable sections
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Const NBGCSVFile = 2
Dim strArrayGCSVFile (2)
'------------------------------------------------------------------------------
Sub InitCSVFileArray ()
'------------------------------------------------------------------------------
strArrayGCSVFile(1) = "Equal_Angles"
strArrayGCSVFile(2) = "Tees"
End Sub '///////////////////////////////////////////////
InitCSVFileArray
'------------------------------------------------------------------------------
Sub GetPath ()
'------------------------------------------------------------------------------
strGInputPath = InputBox("Path of the catalog input
directory:", _
"Input path for CSV", _
"e: \users \jcm \USER \CsvFiles \")
strGOutputPath = InputBox("Path of the catalog output
directory:", _
"Output path for CSV", _
"e: \users \jcm \USER \")
End Sub '///////////////////////////////////////////////
GetPath
'------------------------------------------------------------------------------
Sub CATMain ()
'------------------------------------------------------------------------------
Dim objCatalogDoc As Document
Dim intK As Integer
Dim strCSVFile
Dim strCatalogFile
InitCSVFileArray
GetPath
On Error Resume Next
For intK = 1 to NBGCSVFile
strCSVFile = strGInputPath & strArrayGCSVFile (intK) &
".csv"
strCatalogFile = strGOutputPath & strArrayGCSVFile (intK) &
".catalog"
Set objCatalogDoc =
CATIA.Documents.Add("CatalogDocument")
'---------- Generate catalog
objCatalogDoc.CreateCatalogFromcsv strCSVFile,strCatalogFile
Next 'For intK
MsgBox "Press OK to quit", 0, "CATALOG CREATION COMPLETED"
End Sub '///////////////////////////////////////////////
CATMain
|
|
|
- If you want to use it, copy it and change
the User customizable sections to adapt them to your environment, or
copy a sample CATScript from the one of the standard catalogs supplied
with the product and change it.
|
|
|
CHAPTER
- Open the file USER_Chapter.CATScript. In
our example, the content is as illustrated above.
- f you want to use it, copy it and change the
User customizable sections to adapt them to your environment, or copy
a sample CATScript from the one of the standard catalogs supplied with
the product and change it.
|
|
6. |
You are now ready to run the
batch operation: |
|
|
- Start a Version 5 session
- Select Tools ->Macro ->Macros...
- In the Macro dialog box, set Macro in to External File
- Select the appropriate CATScript, then click Run.
It is important to run the CATScript generating the families (END
CHAPTERS) before the one generating the chapter (CHAPTER) since the
chapter references the families. |
 |
Completing Parametric Section Catalogs
|
 |
This task shows how to add sections
to existing catalogs. |
 |
To add sections to existing catalogs, you must rename
the path of linked documents in CSV files because these files contain
the full path name. To do so, one Excel file per sample catalog
containing an appropriate macro is provided. For example, the Excel file
for the OTUA catalog is OTUA_hierarchy.xls. Excel files are located in
the CsvFiles directory. |
 |
1 |
Edit the Commands sheet of the appropriate Excel file,
entering the necessary information.
Note: The first sheet named Data contains all CSV files in the
catalog. |
|
2. |
Click Modify absolute path of pointed CATPart in CSV
files to rename the path. |
|
3. |
Add new sections. |
|
4. |
Generate the catalog as above. |
 |