cad图整理
2024-10-21 11:39:27
UF_initialize();
tag_t ObjectTag = NULL_TAG;
tag_t view_tag = NULL_TAG;
UF_OBJ_disp_props_t disp_props;
int Type, SubType, quantity=0;
char msg[256];
//实体
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_solid_type, &ObjectTag); //UF_solid_type移动到1层
while (ObjectTag != NULL_TAG)
{
quantity++;
UF_OBJ_ask_type_and_subtype(ObjectTag, &Type, &SubType);
if (Type == UF_solid_type)
{
UF_OBJ_set_layer(ObjectTag, 1);
}
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_solid_type, &ObjectTag);
}
//直线
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_line_type, &ObjectTag); //UF_line_type移到10层
while (ObjectTag != NULL_TAG)
{
quantity++;
UF_OBJ_ask_display_properties(ObjectTag,&disp_props);
UF_OBJ_ask_type_and_subtype(ObjectTag, &Type, &SubType); if (Type == UF_line_type &&disp_props.color==1 &&disp_props.font==UF_OBJ_FONT_SOLID )//白色直线移动到10层
{
UF_OBJ_set_layer(ObjectTag, 10);
}
if (Type == UF_line_type &&disp_props.color!=1 &&disp_props.font==UF_OBJ_FONT_SOLID )//非白色直线移动到11层
{
UF_OBJ_set_layer(ObjectTag, 11);
}
if (Type == UF_line_type &&disp_props.font==UF_OBJ_FONT_DASHED)//虚线移动到12层
{
UF_OBJ_set_layer(ObjectTag, 12);
}
if (Type == UF_line_type &&disp_props.font==UF_OBJ_FONT_CENTERLINE)//4->中心线移动到255层
{
UF_OBJ_set_layer(ObjectTag, 255);
}
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_line_type, &ObjectTag);
}
//圆弧
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_circle_type, &ObjectTag); //UF_circle_type移到10层
while (ObjectTag != NULL_TAG)
{
quantity++;
UF_OBJ_ask_display_properties(ObjectTag,&disp_props);
UF_OBJ_ask_type_and_subtype(ObjectTag, &Type, &SubType); if (Type == UF_circle_type &&disp_props.color==1 &&disp_props.font==UF_OBJ_FONT_SOLID )//白色圆弧移动到10层
{
UF_OBJ_set_layer(ObjectTag, 10);
}
if (Type == UF_circle_type &&disp_props.color!=1 &&disp_props.font==UF_OBJ_FONT_SOLID )//白色圆弧移动到10层
{
UF_OBJ_set_layer(ObjectTag, 11);
}
if (Type == UF_circle_type &&disp_props.font==UF_OBJ_FONT_DASHED)//虚线移动到12层
{
UF_OBJ_set_layer(ObjectTag, 12);
}
if (Type == UF_circle_type &&disp_props.font==UF_OBJ_FONT_CENTERLINE)//4->中心线移动到255层
{
UF_OBJ_set_layer(ObjectTag, 255);
}
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_circle_type, &ObjectTag);
}
//样条曲线
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_spline_type, &ObjectTag);//UF_spline_type移动到10层UF_spline_type while (ObjectTag != NULL_TAG)
{
quantity++;
UF_OBJ_ask_display_properties(ObjectTag,&disp_props);
UF_OBJ_ask_type_and_subtype(ObjectTag, &Type, &SubType);
if (Type == UF_spline_type &&disp_props.color==1 &&disp_props.font==UF_OBJ_FONT_SOLID )
{
UF_OBJ_set_layer(ObjectTag, 10);
} if (Type == UF_spline_type &&disp_props.color!=1 &&disp_props.font==UF_OBJ_FONT_SOLID )
{
UF_OBJ_set_layer(ObjectTag, 11);
}
if (Type == UF_spline_type &&disp_props.font==UF_OBJ_FONT_DASHED)//虚线移动到12层
{
UF_OBJ_set_layer(ObjectTag, 12);
}
if (Type == UF_spline_type &&disp_props.font==UF_OBJ_FONT_CENTERLINE)//4->中心线移动到255层
{
UF_OBJ_set_layer(ObjectTag, 255);
}
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_spline_type, &ObjectTag);
}
//注释阴影等
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_drafting_entity_type, &ObjectTag);//UF_drafting_entity_type移动到256层 while (ObjectTag != NULL_TAG)
{
quantity++;
UF_OBJ_ask_type_and_subtype(ObjectTag, &Type, &SubType);
if (Type == UF_drafting_entity_type)
{
UF_OBJ_set_layer(ObjectTag, 256);
}
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_drafting_entity_type, &ObjectTag);
}
//点
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_point_type, &ObjectTag);//UF_point_type移动到256层UF_spline_type while (ObjectTag != NULL_TAG)
{
quantity++;
UF_OBJ_ask_type_and_subtype(ObjectTag, &Type, &SubType);
if (Type == UF_point_type)
{
UF_OBJ_set_layer(ObjectTag, 256);
}
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_point_type, &ObjectTag);
}
//坐标
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_coordinate_system_type, &ObjectTag);//移动到256层 while (ObjectTag != NULL_TAG)
{
quantity++;
UF_OBJ_ask_type_and_subtype(ObjectTag, &Type, &SubType);
if (Type == UF_coordinate_system_type)
{
UF_OBJ_set_layer(ObjectTag, 256);
}
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_coordinate_system_type, &ObjectTag);
} UF_LAYER_set_all_but_work(4);
UF_LAYER_set_status(1,1);
UF_LAYER_set_status(10,2); sprintf(msg,"循环了%d次",quantity);
uc1601(msg,1);
UF_VIEW_fit_view(view_tag,0.8);
UF_terminate();
最新文章
- C#初步应用
- 简述ES5 ES6
- PDO数据库抽象层
- Windows Azure 使用体验
- 异步IO模型和Overlapped结构
- IntelliJ IDEA 教程(1)
- HBase 协处理器实现二级索引
- GOjs版本2.0去除水印
- React时间组件(时分秒补0)页面全局引用
- [转]Building a REST-Backend for Angular with Node.js &; Express
- MyBatis基础入门《七》查询参数传入对象
- hdu2732 Leapin' Lizards 最大流+拆点
- SQL Fundamentals || Single-Row Functions || 日期函数date functions
- git的使用方法学习
- linux sleep用法
- JavaScript的DOM操作获取元素的大小
- $一步一步学Matlab(4)——使用Matlab进行初等数学运算
- 关于Visual studio 2017安装方法的若干问题
- django-cbv模式-csrf中间件
- 奔跑吧,OpenStack现场分享:超融合架构如何抹平物理硬件差异?