iCAx开思工具箱

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 21600|回复: 0
打印 上一主题 下一主题

有关草图中的约束问题

[复制链接]
跳转到指定楼层
楼主
发表于 2012-12-17 19:43:44 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

马上注册登录,享用更多网站功能!

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

x

我想通过草图中的二维约束来实现点.1和CenterPoint的相合约束。
点.1是通过直线.1的两个顶点CreatePointBetween来建立的。
CATIGSMPointBetween_var piCenterPoint = NULL_var;
  piCenterPoint = _pGSMFact->CreatePointBetween(pLinePoint1,pLinePoint2,ratioParm,CATGSMSameOrientation,CopySelectLine);
  if (piCenterPoint==NULL_var)
  {
   cout<<"创建中点失败,请检查!!!"<<endl;
   return FALSE;
  }
  else
   cout<<"创建中点成功!!!"<<endl;
CATISpecObject_var pLineCenterPoint = NULL_var;
  pLineCenterPoint=piCenterPoint;//存储中点
二维约束的实现
piSketch->OpenEdition();//关键
CATI2DConstraintFactory * spConstraint= NULL;
rc = piSketch->QueryInterface(IID_CATI2DConstraintFactory,(void **)&spConstraint);
if (SUCCEEDED(rc))
{
  cout<<"查询CATI2DConstraintFactory成功"<<endl;
  spConstraint->CreateConstraint( spLineFeat, NULL,CopySelectLine, NULL, NULL, NULL, NULL,
   Cst2DType_On, 0, 0 );
  spConstraint->CreateConstraint(spPointFeat, NULL,pLineCenterPoint, NULL, NULL, NULL, NULL,
     Cst2DType_On, 0, 0);
}
piSketch->CloseEdition();
其中第一个约束可以添加,第二个约束里如将pLineCenterPoint换为pLinePoint1,则可以实现约束。
为什么是pLineCenterPoint就不能实现呢?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 支持支持
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手板模型制作,在线3D打印服务

QQ|小黑屋|手机版|开思工具箱 CAD工具箱_CAM工具箱  

GMT+8, 2024-6-2 02:06 , Processed in 0.012729 second(s), 10 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

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