DMU Kinematics Simulator

Creating a Dress Up Automatically


This macro shows you how to create a dressup object associated to a mechanism defined on a sub-product.

The product on which this macro is used has the following structure:

The integrator_level product contains an architect_level product on which a mechanism is defined based on wireframe elements such as points, lines and planes:

  • The parts of the mechanim are:

fix_wireframe1

driver_wireframe1

rod _wireframe1

piston _wireframe1.

  • The integrator_level product has the following 3D part:

designer_level_fix.1

designer_level_driver.1

designer_level_rod.1

designer_level_piston1.

The purpose of this macro is to create a Dressup under the integrator_level on Mechanism.1.
This dressup will associate all the parts of the mechanism with the 3D parts directly under the root product. This dressup attachement is based on the name of the parts: For instance fix_wireframe.1 will be attached to the 3D part designer_level_fix.1.

After running the macro a dressup is created.

CAAKiiDressupCreation is launched in CATIA [1]. You need to previously open the provided document.

CAAKiiDressupCreation.CATScript is located in the CAAScdKiiUseCases module. Execute macro (Windows only).

CAAKiiDressupCreation

has a main subroutine with the following steps:

Retrieve the root product
Retrieve Dressups collection from the root product
Retrieve all the mechanisms including the sub-mechanisms
Retrieve all the corresponding context for each mechanism
Compute the maximum rank of PossibleMecList
Loop for automatic dressup creation only for sub-mechanisms

CAAKiiDressupCreation includes also the AutomaticDressup subroutine:

Retrieve all the first level products under the root product
Create a new dressup object associated to iMechanism
Loop on all the products of the mechanism
Loop on all first level Product
Compare the name between link and Product_j
Perform Dressup attachement

CAAKiiDressupCreation includes also the ComparProductName function.

Main subroutine

Retrieve the root product

RootProduct

: it represents the root of the product graph.

Retrieve Dressups collection from the root product

MyDressups: it represents the dressup collection for this product. This collection is retrieved using the GetTechnologicalObject method, with the string "Dressups".

Retrieve all the mechanisms including the sub-mechanisms

PossibleMecList: It represents the list of possible mechanism on which a dressup can be created. This list contains all the mechanisms under the root product and also all the mechanisms defined in the sub-products.

This list is given by the ListPossibleMechanisms method on the MyDressups object.

Retrieve all corresponding context for each mechanism

MecContextList: Each mechanism from the previous PossibleMecList is defined under a specific product, called context and it appears in this list.
This list is given by the ListMechanismsContext method on the MyDressups object.The context of PossibleMecList(i) mecanism is MecContextList(i) product.

Compute the maximum rank of PossibleMecList

PossibleMecList(i):The rank of this list varies between 0 to ubound(PossibleMecList). If the list is empty the ubound function will return -1.
ubound(PossibleMecList)+1 can be also seen as the size of this list.


Loop for automatic dressup creation only for sub-mechanisms

For each couple (Mechanism,Context) the subroutine AutomaticDressup is called in order to create a dressup object.

Automatic Dressup subroutine

Retrieve all the first level products under the Root Product

FirsLevelProducts: It represents the collection of product under the root product.

Create a new dressup object associated to iMechanism

The Add method is used on the iDressups collection to create the NewDressupobject.

Loop on all the products of the mechanism

This first loop concerns all the parts of the mechanism, they can be potentially attached.

Loop on all first level Product

This second loop is embedded in the previous one.

Compare the name between link and Product_j

The macro compares names of a given part of the mechanism with a product through the ComparProductName function. If the comparison is OK an attachement between Link and Product_j is done.

Perform Dressup attachement

The Attach method is used on the NewDressup object in order to attach Link to product_j

ComparProductName function

This function compares the name between two products: iLink as a given part of a mechanism and iProduct. All the parts of the mechanism are suffixed by "_wireframe.1". ' iProduct is OK for comparison if it contains the previous name without its suffix.

For instance, the comparison is OK for: fix_wireframe.1 and designer_level_fix.1.

[Top]


In Short

This use case has shown how to create a simple dressup, so that it can be simulated. Specifically, it has illustrated how to:

[Top]


References

[1] Replaying a Macro
[2] DMU Kinematics Automation Objects

[Top]


DMU Navigator Home DMU Space Analysis Home DMU Kinematics Simulation Home

Copyright © 2001, Dassault Systèmes. All rights reserved.