• WAP手机版 RSS订阅 加入收藏  设为首页
CATIA

CATIA CAA 二次开发 详细教程

时间:2011/11/3 12:25:35   作者:未知   来源:网络文摘   阅读:4596   评论:0

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();
CATIA_CAA_二次开发_详细教程


免责申明:CAD之家旨在相互学习交流,是一个完全免费的网站,部分原创作品,欢迎转载,部分内容来自互联网,如果侵犯了您的权利请尽快通知我们!
邮箱:qm198794@gmail.com Copyright 2008-2022 CAD之家网 湘ICP备17006806号