找回密码 注册 QQ登录
一站式解决方案

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 20284|回复: 10
打印 上一主题 下一主题

CAA中”Paste As Special With Link“命令有没有现成的接口API?

[复制链接]
跳转到指定楼层
1
发表于 2005-3-8 10:03:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
CATIA中有个Paste Special 命令,可以让粘贴后的实体与原来保持关联。而一般的粘贴仅仅是得到一个结果。请问在CAA中如何做Paste Special 命令?我现在需要让粘贴后的实体与原来保持关联。谢谢了!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2005-3-8 10:27:07 | 只看该作者
CATMmrInterPartCopy
3
发表于 2005-3-8 11:41:35 | 只看该作者
老兄,找不到CATMmrInterPartCopy 这个接口啊??你用的是什么版本啊?我用的V5R11没有呀。
4
发表于 2005-3-8 12:12:06 | 只看该作者
这是个nodoc的interface,11应该有吧,不公开但可以用
你可以去直接查它的.h文件
5
发表于 2005-3-8 13:42:12 | 只看该作者
nodoc?没有文档的么?在CAA V5Help Viewer中是无法查到这个接口,.h文件也找不到啊。即使可用,那怎么用还是很茫然呢。acoka 兄能否提供个例子?不情之请,呵呵,请勿怪。
6
发表于 2005-3-8 14:27:39 | 只看该作者
给你它的.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
7
发表于 2005-3-8 16:02:24 | 只看该作者
多谢acoka的不厌其烦。也许11版就是没有这个命令吧。“Cannot open include file: 'CATMmrInterPartCopy.h': No such file or directory”。我在安装文件夹里面去寻找这个头文件,也是找不到。无可奈何了。不过不管怎样,还是多谢了。
8
发表于 2005-3-8 17:08:54 | 只看该作者
实际上,CATICutAndPastable也可以实现AsResultWithLink吧?但是要设置CATFormat。不知如何做?我做法如下:
IdFormat name = "AsResultWithLink";
CATFormat *pFormat = new CATFormat(name);
但是结果不对。
请问应该如何得到指定IdFormat 的CATFormat?CATFormat的函数很少。多谢。
9
发表于 2005-3-9 14:51:48 | 只看该作者
没有人再关注这个话题么?呵呵。
10
发表于 2010-4-15 09:38:33 | 只看该作者
r16版本里有“CATMmrInterPartCopy.h”这个文件。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-12-23 09:31 , Processed in 0.031007 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

快速回复 返回顶部 返回列表