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

iCAx开思网

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

[原创] 有关草图中的约束问题

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

我想通过草图中的二维约束来实现点.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就不能实现呢?

本帖子中包含更多资源

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

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

GMT+8, 2024-5-29 23:27 , Processed in 0.021123 second(s), 12 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

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