All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

MechanicalModeler Class CATMmrInterPartCopy

CATMmrInterPartCopy
 

Usage: you must use this class as is. You should never derive it.


public class CATMmrInterPartCopy

Class to manage inter and intra part copy as result.
Role:This class allows to simulate a copy/paste special as result (with link or not) in a easier way than CATICutAndPastable . Usage :Use a constructor to give the input object and target, then use the Run method then the GetResult method.


Constructor and Destructor Index


o CATMmrInterPartCopy(CATIBRepAccess_var&,CATISpecObject_var&)
Constructor with a source subelement and a target feature for the copy.
o CATMmrInterPartCopy(CATICkeParm_var&,CATISpecObject_var&)
Constructor with a source parameter and a target feature for the copy.
o CATMmrInterPartCopy(CATISpecObject_var&,CATISpecObject_var&)
Constructor with a source feature and a target feature for the copy.
o CATMmrInterPartCopy(CATPathElement*,CATPathElement*)
Constructor with a source path and a target path.
o ~CATMmrInterPartCopy()
Destructor

Method Index


o GetCreationStatus()
Returns creation status.
o GetResult(CATISpecObject_var&)
Retrieves the computed result.
o Run(CATUnicodeString*)
Computes the copy according to specified input.
o SetAttributeMode(int)
Sets the copy mode for attributes when copying without keeping a link.
o SetImportApplicativeId(GUID&)
Sets an applicative identifier on the mechanical imports.
o SetLinkMode(CATBoolean)
Sets the link option (with or without link) to override default setting (keep link).
o SetSourceInstance(CATIProduct*)
Selects the product instance of the object.
o SetTargetInstance(CATIProduct*)
Selects the product instance of the target.
o SetTypeOfCreatedSolidSet(CATBoolean)
Sets the type of created solid set.

Constructor and Destructor


o CATMmrInterPartCopy
public CATMmrInterPartCopy( const CATIBRepAccess_var& iElementToCopy,
const CATISpecObject_var& iTarget)
Constructor with a source subelement and a target feature for the copy.
Parameters:
iElementToCopy
a rsur, redge, vertex obtained from selection of a subelement
iTarget
a part, solid or surfacic feature set
o CATMmrInterPartCopy
public CATMmrInterPartCopy( const CATICkeParm_var& iElementToCopy,
const CATISpecObject_var& iTarget)
Constructor with a source parameter and a target feature for the copy.
Parameters:
iElementToCopy
a cke parameter
iTarget
Target is a part, solid or surfacic feature set
o CATMmrInterPartCopy
public CATMmrInterPartCopy( const CATISpecObject_var& iObjectToCopy,
const CATISpecObject_var& iTarget)
Constructor with a source feature and a target feature for the copy.
Parameters:
iObjectToCopy
a curve, line, surface, plane, point, sketch, solid feature set
iTarget
a part, solid or surfacic feature set
o CATMmrInterPartCopy
public CATMmrInterPartCopy(CATPathElement* iObject,
CATPathElement* iTarget)
Constructor with a source path and a target path.
Parameters:
iObject
path may contain (product instance +) part + feature or subelement
iTarget
Target path may contain a product instance, a part, solid or surfacic feature set
o ~CATMmrInterPartCopy
public ~CATMmrInterPartCopy()
Destructor

Methods


o GetCreationStatus
public HRESULT GetCreationStatus()
Returns creation status.
Role: after computing the copy, this method will return S_FALSE if the result already existed and so was not created. This is only the case for a contextual import in an assembly.
Parameters:
oResult
status
Returns:
S_OK if an object was created, S_FALSE if result already existed, E_FAIL otherwise
o GetResult
public HRESULT GetResult(CATISpecObject_var& oResult)
Retrieves the computed result.
Parameters:
oResult
The result of the copy (if ok). Use this method after the
Run execution.
Returns:
S_OK if result exists, E_FAIL otherwise
o Run
public HRESULT Run(CATUnicodeString* oString= NULL)
Computes the copy according to specified input.
Role: after constructing the class, select link mode if needed and then use method Run before getting the result with GetResult .
Parameters:
oString
Error Message
Returns:
S_OK if copy is done, E_FAIL otherwise
o SetAttributeMode
public HRESULT SetAttributeMode(int iMode)
Sets the copy mode for attributes when copying without keeping a link.
Role: Allows to specify which attributes are copied. By default, if this method is not called BRep-attributes and colors on sub-elements are not copied. This method allows to copy color and/or attributes.
This method has no effect on copies with link, for which colors and attributes are copied according to the setting in PartInfrastructure/PartDocument.
This method must be called before the Run method.
Parameters:
iMode
0 : color and BRep-attributes are not copied
1: color is copied, not BRep-attributes
2: BRep-attributes are copied, not color
3: BRep-attributes and colors are copied
Returns:
S_OK if mode is accepted, E_FAIL otherwise
See also:
CATMmrApplicativeAttributes
o SetImportApplicativeId
public HRESULT SetImportApplicativeId( const GUID& iApplicativeId)
Sets an applicative identifier on the mechanical imports.
Role: it enables to associate an identifier with the mechanical import feature which is the result of the copy (or the elements of the result if it is a surface set or a solid set).
This identifier allows to retrieve information on the mechanical import using interface CATIMmiMechanicalImportApplicative .
This method must be called before the Run method and it only applies if the link mode is set to true.
Parameters:
iApplicativeId
The unique identifier generated by the application.
  • on Windows, use : uuidgen -s
  • on Unix, use : uuid_gen -C
Refer to the article "About Globally Unique IDentifiers" in the CAA encyclopedia for more details about these two ways of generating a GUID value.
o SetLinkMode
public HRESULT SetLinkMode(CATBoolean iMode)
Sets the link option (with or without link) to override default setting (keep link).
Parameters:
iMode
TRUE to keep the link, FALSE otherwise
Returns:
S_OK if mode is accepted, E_FAIL otherwise
o SetSourceInstance
public HRESULT SetSourceInstance(CATIProduct* iProd)
Selects the product instance of the object.
Role: for contextual link, you may specify the instance of the source part. It can also be specified with the constructor with pathelement.
Parameters:
iProd
the selected instance will be used to determine the product context
Returns:
S_OK if instance is accepted, E_FAIL otherwise
o SetTargetInstance
public HRESULT SetTargetInstance(CATIProduct* iProd)
Selects the product instance of the target.
Role: for contextual link, you may specify the instance of the target part. It can also be specified with the constructor with pathelement.
Parameters:
iProd
the selected product instance used as a context for the contextual link
Returns:
S_OK if instance is accepted, E_FAIL otherwise
o SetTypeOfCreatedSolidSet
public HRESULT SetTypeOfCreatedSolidSet(CATBoolean iIsAnOrderedSet)
Sets the type of created solid set.
Role: Specifies the type of solid set, Solid Body (MechanicalTool startup) or Body (HybridBody startup), that will be created during import (Run method). This parameter is applicable only in case of solid import. If the type is not specified, the type of solid set that will be created will be based on "Hybrid Design" setting value.
Parameters:
iIsAnOrderedSet
If TRUE, the created body is a Body. If FALSE, the created body is a Solid Body.
Returns:
S_OK if set is accepted, E_FAIL otherwise

This object is included in the file: CATMmrInterPartCopy.h
If needed, your Imakefile.mk should include the module: CATMechanicalModeler

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