玩软件 > CATIA
+

CATIA CAA 二次开发 详细教程

2011-11-03    作者:未知    来源:网络文摘

1)创建三个点(参见教程5)
2) 将点连成线(参见教程6)
3) 通过三点创建一个参考平面,后面进行圆弧倒角时要用到该平面。
CATIGSMPlane3Points_var Supportplane = spGSMFactory->CreatePlane(spPoint1, spPoint2,spPoint3);
CATISpecObject_var spSupportplane = Supportplane;
4) 创建倒角半径的参数:
CATICkeParm_var Radius1 = NULL_var;
CATICkeMagnitude_var spRadMag = spParamDictionary->FindMagnitude("LENGTH");
CATUnicodeString name("Radius 1");
Radius1 = spParmFactory->CreateDimension(spRadMag,name, .01);
5) 创建倒角::
CATIGSMCorner_var Corner1 = spGSMFactory->CreateCorner(spLine1,
spLine2,
spSupportplane,
Radius1,
CATGSMSameOrientation,
CATGSMSameOrientation,
FALSE);
CATISpecObject_var spCorner1 = Corner1;
6) 裁剪去多余的线和点:
CATIGSMSplit_var Split1 = spGSMFactory->CreateSplit(spLine1,
spRadius1,
CATGSMSameOrientation);
CATISpecObject_var spSplit1 = Split1;

CATIGSMSplit_var Split1a = spGSMFactory->CreateSplit(spSplit1,
spRadius3,
CATGSMInvertOrientation);
CATISpecObject_var spSplit1a = Split1a;
7) 将线和圆弧依次连接起来,创建一个序列:
CATLISTV(CATISpecObject_var) joincurves;
joincurves.Append(spSplit1a);
joincurves.Append(spSplit2a);
joincurves.Append(spSplit3a);
joincurves.Append(spRadius1);
joincurves.Append(spRadius2);
joincurves.Append(spRadius3);
8)在讲序列连接起来之前,需要创建一个最小的结合距离:
CATICkeParm_var Mergedist = NULL_var;
CATICkeMagnitude_var spMergedist = spParamDictionary->FindMagnitude("LENGTH");
CATUnicodeString mergename("Merge Distance");
Mergedist = spParmFactory->CreateDimension(spMergedist,
mergename,
.0001);
9)连接起来并插入到视图中:
Now we can join this list of objects into a single shape and insert it into the part.
CATIGSMAssemble_var CurveAssy = spGSMFactory->CreateAssemble(joincurves,
Mergedist,
FALSE);
CATISpecObject_var spCurveAssy = CurveAssy;

spCurveAssy->Update();
CATIGSMProceduralView_var spCurObj = Curveassembly;
spCurObj->InsertInProceduralView();

阅读:3993    评论:0
  • 相关文章
  • 热门文章
  • 相关评论
网站地图

免责申明:我要玩起网旨在提供一个相互学习交流的平台,是一个完全免费的网站,部分原创作品,欢迎转载,部分内容来自互联网,如果侵犯了您的权利请尽快通知我们!邮箱:279459762@qq.com Copyright 2018-2021我要玩起网

湘ICP备17006802号-2
【电脑版】  【回到顶部】