ug2次开发教程_cad二次开发实例lisp实例

编程文档 (69) 2023-03-24 15:01

UF是使用C语言的,所以有C语言的结构,枚举,指针,预定义常数等等,也有一定的数据结构。

笔记方式是直接使用实例进行,并对出现过的各种数据,自定义类型进行总结。

通过对API文档的翻译,函数分析,实例进行学习,重点是总结各个出现过的数据类型。

关注评论,如果需要认识配置开发环境,告知我哦。

UF_MODL_create_cyl1函数

ug2次开发教程_cad二次开发实例lisp实例_https://bianchenghao6.com/blog_编程文档_第1张

一,需要添加的头文件:uf_modl_primitives.h

二,概述:

Creates a cylinder.

创建一个圆柱体。

The origin indicates where the center of the bottom face is located for the cylinder.

圆柱体的原点

The direction vector controls the axis on which the cylinder is created.

圆柱体的方向向量,即圆柱体的轴

The diameter and height control the size of the cylinder.

圆柱体的直径和高度

The sign parameter controls the boolean operation performed.

sign参数控制执行布尔运算。

The output of this function is the object identifier associated to the cylinder.

此函数的输出是对象与圆柱体关联的标识符。

三,环境:内部和外部
四,需要许可证(S):solid_modeling

五,函数原型:

int UF_MODL_create_cyl1
(
UF_FEATURE_SIGN sign,
double origin [ 3 ] ,
char * height,
char * diam,
double direction [ 3 ] ,
tag_t * cyl_obj_id
);

每一个函数都有其返回值,返回一个int数值。

函数名分析:int UF_MODL_create_cyl1

UF即UF函数;

MODL即建模模块;

create,创建;

block:函数实际功能实体。

六,UF_FEATURE_SIGN sign, 枚举类型,上一文章出现过。,请参考:

UG NX OPEN 二次开发实例:UFUN(C语言)API文档翻译,创建块

七,各数据类型说明运行。

ug2次开发教程_cad二次开发实例lisp实例_https://bianchenghao6.com/blog_编程文档_第2张

八,实际代码:

UF_FEATURE_SIGN sign = UF_NULLSIGN;
double origin [ 3 ] = {0.0, 0.0, 0.0};
char * height = "30";
char * diam = "15";
double direction [ 3 ] = {1.0, 0.0, 0.0};
tag_t cyl_obj_id;

UF_MODL_create_cyl1(
sign,
origin ,
height,
diam,
direction,
&cyl_obj_id //输出圆柱体特征
);

ug2次开发教程_cad二次开发实例lisp实例_https://bianchenghao6.com/blog_编程文档_第3张

上一篇

已是最后文章

发表回复