|
Opening and Editing a
Macro
-
To Open and edit the macro:
-
Select Tools > Macro > Macros
in DMU Space Analysis menu bar
-
Identify the folder containing the
macro, select the CATScript then click Edit...
-
Add the name and path of the
CATProduct that will be opened and that will contain clash results.
-
Typically, this CATProduct document
contains the products on which the interference analysis was run.
-
Add the name and path of the XML file
containing the clash results you want to import.
-
Save the macro.
|
Looking at a Sample Macro
-
The following macro extract will help you to
Sub CATMain()
' 1 - Load the document
sProductPath = CATIA.SystemService.Environ("E: \tmp \ImportXMLTest")
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Set productDocument1 = documents1.Open("E: \tmp \ImportXMLTest.CATProduct")
CATIA.ActiveWindow.ActiveViewer.Viewpoint3D.ProjectionMode = 0
' 2 - Retrieve the Clashes collection
Dim rClashes As ClashResults
Set rClashes =
CATIA.ActiveDocument.Product.GetTechnologicalObject("ClashResults")
' 3 - Read a clash stored on the disk, and import it in the active
document
Dim rClash As ClashResult
Set rClash = rClashes.AddFromXML("E: \tmp \XML_file_to_Import.xml",
CatClashImportTypeClashOnly)
End Sub
|
Running the Macro
-
Click Run to run the macro. A
CATProduct is opened in your current DMU session.
-
Double-click the results to analyze them
using the Clash command.
 |
Selecting the Compute all numeric and graphic results
check box in the DMU Clash tab page (Tools > Options > Digital
Mockup > DMU Space Analysis) means that all numeric and graphic
results are computed and displayed directly when you import clash
results via the macro.
This is useful when presenting results in a meeting
for example. Cleared, the detailed computation will only be run as
you select conflicts in the Check Clash dialog box. |
-
(Optional) Add your macro to a toolbar if
desired using the Tools > Customize... command.
 |
-
Select the Commands tab, then
-
the Macros category: all macros will be
detected and listed.
-
You can then drag and drop onto toolbars for
convenient access.
|
Importing
XML Clash Results & VPM
-
You can also import clash results saved in XML files that
concern products stored in VPM. For this:
|
|
 |
For more information on CATDMUBuilder, read "Running
the CATDMUBuilder
Batch Process" in the DMU Navigator User's Guide |
|