CATIA技术交流论坛

 找回密码
 点击注册
查看: 481|回复: 0

CATIA CAA 二次开发详细教程 第九讲:创建圆角三角形

[复制链接]

1684

主题

1726

帖子

4266

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
4266
发表于 2018-1-26 14:14:05 | 显示全部楼层 |阅读模式
(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();
        

本帖子中包含更多资源

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

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点击注册

本版积分规则

手机|小黑屋|CATIA技术交流论坛

GMT+8, 2019-12-15 14:20 , Processed in 0.033947 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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