iCAx开思网

标题: CAA中”Paste As Special With Link“命令有没有现成的接口API? [打印本页]

作者: cms_nuaa    时间: 2005-3-8 10:03
标题: CAA中”Paste As Special With Link“命令有没有现成的接口API?
CATIA中有个Paste Special 命令,可以让粘贴后的实体与原来保持关联。而一般的粘贴仅仅是得到一个结果。请问在CAA中如何做Paste Special 命令?我现在需要让粘贴后的实体与原来保持关联。谢谢了!
作者: acoka    时间: 2005-3-8 10:27
CATMmrInterPartCopy
作者: cms_nuaa    时间: 2005-3-8 11:41
老兄,找不到CATMmrInterPartCopy 这个接口啊??你用的是什么版本啊?我用的V5R11没有呀。
作者: acoka    时间: 2005-3-8 12:12
这是个nodoc的interface,11应该有吧,不公开但可以用
你可以去直接查它的.h文件
作者: cms_nuaa    时间: 2005-3-8 13:42
nodoc?没有文档的么?在CAA V5Help Viewer中是无法查到这个接口,.h文件也找不到啊。即使可用,那怎么用还是很茫然呢。acoka 兄能否提供个例子?不情之请,呵呵,请勿怪。
作者: acoka    时间: 2005-3-8 14:27
给你它的.h文件, new它就好
  
// COPYRIGHT DASSAULT SYSTEMES 2003
/**
  * @CAA2Level L0
  * @CAA2Usage U0
  */
#ifndef CATMmrInterPartCopy_H
#define CATMmrInterPartCopy_H
  
#include "CATBaseUnknown.h"
#include "CATMechanicalModeler.h"
#include "CATBoolean.h"
#include "CATUnicodeString.h"
#include "CATIContainer.h"
#include "CATISpecObject.h"
#include "CATImportSettingBehavior.h"
class CATIProduct;
class CATIBRepAccess_var;
class CATICkeParm_var;
class CATPathElement;
  
/**
  * Class to manage inter and intra part copy as result.
  * <b>Role:</b>This class allows to simulate a copy/paste special as result (with link or not) in a easier way than
  * @href CATICutAndPastable .  
  * <b>Usage :</b>Use a constructor to give the input object and target, then use the @href #Run method then the @href #GetResult method.
  */
class ExportedByCATMechanicalModeler CATMmrInterPartCopy
{
public :
/**
  * Constructor with a source feature and a target feature for the copy.
  * @param iObjectToCopy
  * a curve, line, surface, plane, point, sketch, solid feature set
  * @param iTarget
  * a part, solid or surfacic feature set
  */
  CATMmrInterPartCopy(const CATISpecObject_var[$ iObjectToCopy ,const CATISpecObject_var& iTarget)]
  
/**
  * Constructor with a source subelement and a target feature for the copy.
  * @param iElementToCopy
  * a rsur, redge, vertex obtained from selection of a subelement
  * @param iTarget
  * a part, solid or surfacic feature set
  */
  CATMmrInterPartCopy(const CATIBRepAccess_var[$ iElementToCopy ,const CATISpecObject_var& iTarget)]
/**
  * Constructor with a source parameter and a target feature for the copy.
  * @param iElementToCopy
  * a cke parameter
  * @param iTarget
  * Target is a part, solid or surfacic feature set
  */
  CATMmrInterPartCopy(const CATICkeParm_var[$ iElementToCopy ,const CATISpecObject_var& iTarget)]
  
/**
  * Constructor with a source path and a target path.
  * @param iObject
  * path may contain (product instance +) part + feature or subelement
  * @param iTarget
  * Target path may contain a product instance, a part, solid or surfacic feature set
  *  
  */
  CATMmrInterPartCopy(CATPathElement* iObject ,CATPathElement* iTarget);
/**
  * Selects the product instance of the object.
  * <br><b>Role:</b> for contextual link, you may specify the instance of the source part.  
  * It can also be specified with the constructor with pathelement.
  * @param iProd
  * the selected instance will be used to determine the product context
  * @return
  * S_OK if instance is accepted, E_FAIL otherwise
*/
  HRESULT SetSourceInstance(CATIProduct* iProd);  
                                             
  /**
  * Selects the product instance of the target.
  * <br><b>Role:</b> for contextual link, you may specify the instance of the target part.
  * It can also be specified with the constructor with pathelement.
  * @param iProd
  * the selected product instance used as a context for the contextual link
  * @return
  * S_OK if instance is accepted, E_FAIL otherwise
*/
  HRESULT SetTargetInstance(CATIProduct* iProd);
  
/**
  * Sets the link option (with or without link) to override default setting (keep link).
  * @param iMode
  * TRUE to keep the link, FALSE otherwise
  * @return
  * S_OK if mode is accepted, E_FAIL otherwise
  */
  HRESULT SetLinkMode(CATBoolean iMode);
  
/**
  * Computes the copy according to specified input.
  * <br><b>Role:</b> after constructing the class, select link mode if needed
  * and then use method Run before getting the result with @href #GetResult .
  * @param oString
  * Error Message
  * @return
  * S_OK if copy is done, E_FAIL otherwise
  */
  HRESULT Run(CATUnicodeString* oString = NULL);
                                               
/**
  * Retrieves the result computed with @href #Run .
  * @param oResult
  * result of the copy (if ok).
  * @return
  * S_OK if result exists, E_FAIL otherwise
  */
  HRESULT GetResult(CATISpecObject_var[$ oResult)]
  
/**
  * Returns creation status.
  * <br><b>Role:</b> sometimes the result does not need to be created if it already exists. In this case, this method
  * returns S_FALSE.
  * @param oResult
  * status
  * @return
  * S_OK if object was created, S_FALSE if result already existed, E_FAIL otherwise
  */
  HRESULT GetCreationStatus();
  
/**
  * Destructor
  */
  ~CATMmrInterPartCopy();
private:
/**
  * @nodoc  
  * Copy construction is forbidden
  */
  CATMmrInterPartCopy(const CATMmrInterPartCopy[$)]
  CATISpecObject_var _result;
  CATPathElement* _pathobj,*_pathtrg;
  CATIContainer_var _trgcont;
  CATImportSettingBehavior _keeplink;
  HRESULT _status,_creation;
  
};
  
#endif
作者: cms_nuaa    时间: 2005-3-8 16:02
多谢acoka的不厌其烦。也许11版就是没有这个命令吧。“Cannot open include file: 'CATMmrInterPartCopy.h': No such file or directory”。我在安装文件夹里面去寻找这个头文件,也是找不到。无可奈何了。不过不管怎样,还是多谢了。
作者: cms_nuaa    时间: 2005-3-8 17:08
实际上,CATICutAndPastable也可以实现AsResultWithLink吧?但是要设置CATFormat。不知如何做?我做法如下:
IdFormat name = "AsResultWithLink";
CATFormat *pFormat = new CATFormat(name);
但是结果不对。
请问应该如何得到指定IdFormat 的CATFormat?CATFormat的函数很少。多谢。
作者: cms_nuaa    时间: 2005-3-9 14:51
没有人再关注这个话题么?呵呵。
作者: zjm1228    时间: 2010-4-15 09:38
r16版本里有“CATMmrInterPartCopy.h”这个文件。
作者: goodtings    时间: 2012-8-2 21:22
r19也有。




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3