CATIA CAA 二次开发 详细教程(5)添加一个点(2)
CATIA CAA 二次开发 详细教程
CATI2DCurve_var spCurve2 (spLine2); CATI2DCurve_var spCurve3 (spLine3); CATI2DCurve_var spCurve4 (spLine4);
spCurve1->SetStartPoint(spPt_bottom_left); spCurve1->SetEndPoint(spPt_bottom_right); spCurve2->SetStartPoint(spPt_bottom_right); spCurve2->SetEndPoint(spPt_top_right); spCurve3->SetStartPoint(spPt_top_right); spCurve3->SetEndPoint(spPt_top_left); spCurve4->SetStartPoint(spPt_top_left); spCurve4->SetEndPoint(spPt_bottom_left); 然后退出草图:
spSketch->CloseEdition();
CATIA CAA 二次开发 详细教程(9)创建圆角三角形
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(\GTH\
CATUnicodeString name(\
Radius1 = spParmFactory->CreateDimension(spRadMag,name, .01); 5) 创建倒角::
CATIGSMCorner_var Corner1 = spGSMFactory->CreateCorner(spLine1, spLine2, spSupportplane, Radius1,
CATGSMSameOrientation, CATGSMSameOrientation, FALSE);
CATISpecObject_var spCorner1 = Corner1;
35
CATIA CAA 二次开发 详细教程
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(\
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;
36
CATIA CAA 二次开发 详细教程
spCurObj->InsertInProceduralView();
CATIA CAA 二次开发详细教程(10) 文档操作方法 创建 加载 保存
一、创建(Create the new document)
CATDocument* pDoc = NULL;
rc = CATDocumentServices::New(\ if (NULL != pDoc) {
cout << \ } else {
cout << \ return 2; }
Now that the session is opened, you can create a new document using the New static method of CATDocumentServices. This method creates a document and initializes it, allowing it to be loaded and stored and making it editable. In this use case, a pre-defined document type, \is used as a document type. In interactive mode, this is the name that appears when performing a File/New operation. It is not the file extension, which, in this case, is \
二、打开(Load the document)
37
CATIA CAA 二次开发 详细教程
CATDocument *pDoc = NULL;
rc = CATDocumentServices::Open(argv[1], pDoc); if (SUCCEEDED(rc) && (NULL != pDoc)) {
cout << \ } else {
cout << \ return 2; }
Now that the session is opened, you can load an existing document using the Ope
n static method of CATDocumentServices. This method needs, as a first parameter, the
entire storage path name and document name of the existing document that we want to load into the session. In this use case, we enter this information as an argument to the program. The second parameter of the Open method returns a CATDocumentpointer to the document it has loaded.
Once the document exists in the session, you can work with objects within it, using specific interfaces external to the ObjectModelerBase framework.
三、获取当前文档
CATFrmEditor * pEditor = GetEditor(); if (NULL != pEditor ) {
cout << \ } else {
cout << \ return 1; }
CATDocument *pDoc = pEditor->GetDocument(); if (NULL != pDoc) {
cout << \ } else {
cout << \ return 2; }
38
CATIA CAA 二次开发 详细教程
四、提取根容器(Retrieving the Document Root
Container)
CATInit *piInitOnDoc = NULL;
rc = pDoc -> QueryInterface (IID_CATInit, (void**) &piInitOnDoc); if (FAILED(rc)) {
cout << \ return 3; }
const CATIdent idCATIContainer = \ CATIContainer *piRootContainer = NULL;
piRootContainer = (CATIContainer*) piInitOnDoc -> GetRootContainer(idCATIContainer);
if (NULL == piRootContainer) {
cout << \ return 4; }
The document root container is retrieved using the CATInit::GetRootContainer method. The CATIContainer handle retrieved through GetRootContainer will be necessary whenever you want to create or manipulate objects in the document.
五、保存文档(Save the Document)
5.1 另存
rc = CATDocumentServices::SaveAs (*pDoc, argv[1]); if (SUCCEEDED(rc)) {
cout << \ } else {
cout << \ return 5; }
To save the new document, use the SaveAs static method of CATDocumentServices. This method takes the pointer to the document created by New as a first parameter, and the storage path name and document name under which the document is to be stor
相关推荐:
- [资格考试]机械振动与噪声学部分答案
- [资格考试]空调工程课后思考题部分整合版
- [资格考试]电信登高模拟试题
- [资格考试]2018年上海市徐汇区中考物理二模试卷(
- [资格考试]坐标转换及方里网的相关问题(椭球体、
- [资格考试]语文教研组活动记录表
- [资格考试]广东省2006年高应变考试试题
- [资格考试]LTE学习总结—后台操作-数据配置步骤很
- [资格考试]北京市医疗美容主诊医师和外籍整形外科
- [资格考试]中学生广播稿400字3篇
- [资格考试]CL800双模站点CDMA主分集RSSI差异过大
- [资格考试]泵与泵站考试复习题
- [资格考试]4个万能和弦搞定尤克里里即兴弹唱(入
- [资格考试]咽喉与经络的关系
- [资格考试]《云南省国家通用语言文字条例》学习心
- [资格考试]标准化第三范式
- [资格考试]GB-50016-2014-建筑设计防火规范2018修
- [资格考试]五年级上册品社复习资料(第二单元)
- [资格考试]2.对XX公司领导班子和班子成员意见建议
- [资格考试]关于市区违法建设情况的调研报告
- 二0一五年下半年经营管理目标考核方案
- 2014年春八年级英语下第三次月考
- 北师大版语文二年级上册第十五单元《松
- 2016国网江苏省电力公司招聘高校毕业生
- 多渠道促家长督导家长共育和谐 - 图文
- 2018 - 2019学年高中数学第2章圆锥曲线
- 竞争比合作更重要( - 辩论准备稿)课
- “案例积淀式”校本研训的实践与探索
- 新闻必须客观vs新闻不必客观一辩稿
- 福师大作业 比较视野下的外国文学
- 新编大学英语第二册1-7单元课文翻译及
- 年产13万吨天然气蛋白项目可行性研究报
- 河南省洛阳市2018届高三第二次统一考试
- 地下车库建筑设计探讨
- 南京大学应用学科教授研究方向汇编
- 2018年八年级物理全册 第6章 第4节 来
- 毕业论文-浅析余华小说的悲悯性 - 以《
- 2019年整理乡镇城乡环境综合治理工作总
- 广西民族大学留学生招生简章越南语版本
- 故宫旧称紫禁城简介




