Mechanical Design

Assembly Design

Drafting properties of product's component

Retrieves/sets the drafting properties
Use Case

Abstract

This article discusses the CAAAuiProdDraftingProperties use case. This use case explains how to retrieve and to set the drafting properties for a product's component.


What You Will Learn With This Use Case

This use case is intended to help you make your first steps in programming with CATIA Product Design. Its main intent is to retrieve and set drafting properties of an Product design document. More specifically, you will learn how to:

[Top]

The CAAAuiProdDraftingProperties Use Case

CAAAuiProdDraftingProperties is a use case of the CAAAssemblyUI.edu framework that illustrates the CATAssemblyInterfaces framework capabilities.

Before discussing the use case, some main concepts, about the drafting properties, have to be introduced:

ut [Top]

What Does CAAAuiProdDraftingProperties Do

CAAAuiProdDraftingProperties:

[Top]

How to Launch CAAAuiProdDraftingProperties

To launch CAAAuiProdDraftingProperties, you will need to set up the build time environment, then compile CAAAuiProdDraftingProperties along with its prerequisites, set up the run time environment, and then execute the use case [1].

Launch the use case as follows:

where:

InputDocument Complete path for "ScrewedPlates.CATProduct", usually it is in the resources directory of your RuntimeView
OutputDocument Complete path for "ScrewedPlates_Output.CATProduct", where modified document will be stored 

[Top]

Where to Find the CAAAuiProdDraftingProperties Code

The CAAAuiProdDraftingProperties use case is located in the CAAAuiProdDraftingProperties.m module of the CAAAssemblyUI.edu framework:

Windows InstallRootDirectory\CAAAssemblyUI.edu\CAAAuiProdDraftingProperties.m\
Unix InstallRootDirectory/CAAAssemblyUI.edu/CAAAuiProdDraftingProperties.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Replaying CAAAuiProdDraftingProperties ODT

The required data for CAAAuiProdDraftingProperties ODT is located in the CAAAssemblyUI.tst framework:

Shell script InstallRootDirectory/CAAAssemblyUI.tst/FunctionTests/TestCases/CAAAuiProdDraftingProperties.sh
InputData InstallRootDirectory/CAAAssemblyUI.tst/FunctionTests/TestCases/InputData/ScrewedPlates.CATProduct
Output InstallRootDirectory/CAAAssemblyUI.tst/FunctionTests/TestCases/Output/intel_a/ScrewedPlates_output.CATProduct

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Step-by-Step

There are five main steps in CAAAuiProdDraftingProperties:

  1. Prolog
  2. Retriving and Setting the Hide Line Property.   
  3. Retriving and Setting the Cut Property.   
  4. Retriving and Setting the Projection Property.   
  5. Epilog

We will now comment at each of those sections by looking at the code.

[Top]

Prolog

CAAAuiProdDraftingProperties begins by checking that the command lines contains two argument (Complete path for input CATProduct document  and output CATProduct document ). It then creates a session, and opens a CATProduct document with the help static method OpenDocument of class CATProductDocument. It then retrieves the root document by using CATIDocRoots, and then retrieves Screw.1, Nut.1 and Washer.1 instances (of type CATIProduct). It then modifyes Screw.1 Hidden Line properties, followed by modifying Nut.1 Cut properties then by modifying Washer.1 Projected properties by using CATIProdDraftingProperties method

[Top]

Retriving and Setting the Hide Line Property.

...

// modifying Screw.1 properties,
CATIProdDraftingProperties* piProd_DftProp  =  NULL;

if ( SUCCEEDED( piProd_Screw->QueryInterface( IID_CATIProdDraftingProperties, (void **) & piProd_DftProp ) ) )

{ 
	CATBoolean showHiddenLines = FALSE; 
	piProd_DftProp->GetHiddenLineMode( showHiddenLines ); 
	if ( FALSE == showHiddenLines ) 
	{ piProd_DftProp->SetHiddenLineMode( TRUE ); }
}
// Process next
  ...

The GetHiddenLine returns

TRUE If the Line is Hidden.
FALSE If the Line is Visible.

 

Retriving and Setting the CUT Property .

...

    
// modifying Nut.1 properties,

CATIProdDraftingProperties * piProd_DftProp = NULL;

if ( SUCCEEDED( piProd_Nut->QueryInterface( IID_CATIProdDraftingProperties, (void **) & piProd_DftProp ) ) ) 
{ 
	CATBoolean cut = FALSE; piProd_DftProp->GetCutStatus( cut ); 
	if ( TRUE == cut ) 
	{ piProd_DftProp->SetCutStatus( FALSE ); }
}
// Process next
  ...

The GetCutStatus returns

TRUE The component will be cut when projected in the section view.
FASLE The component will not be cut when projected in the section view.

[Top]

Retriving and Setting the Projected Property .

 ...

    
// modifying Washer.1 properties,

CATIProdDraftingProperties * piProd_DftProp = NULL;
if ( SUCCEEDED( piProd_Washer->QueryInterface( IID_CATIProdDraftingProperties, (void **) & piProd_DftProp ) ) )
{
	CATBoolean use = FALSE;
	piProd_DftProp->GetUseStatus( use );
	if ( TRUE == use ) { piProd_DftProp->SetUseStatus( FALSE ); }
}
// Process next
  ...

The GetUseStatus returns ..

TRUE

The component is Projected when in section view.

FASLE

The component is not Projected when in section view.

[Top]

 

Epilog

Close the document and then session is closed, as usual.

[Top]


In Short

This use case has demonstrated the way to retrive and set the HideLine , Cut and Projection drafting  properties of a Product design document.

[Top]


References

[1] Building and Launching a CAA V5 Use Case
[Top]

History

Version: 1 [Mar 2005] Document created
[Top]

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