zoukankan      html  css  js  c++  java
  • cad图整理

    	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();
    

      

  • 相关阅读:
    MySQL关于check约束无效的解决办法
    关于constraint的用法
    MySQL关于Duplicate entry '1' for key 'PRIMARY'错误
    iOS实现高斯模糊效果(Swift版本)
    iOS获取视频中的指定帧的两种方法
    Java关于e.printStackTrace()介绍
    iOS关于JSONKit解析Unicode字符内容出错,问题出在u0000
    Java转型(向上转型和向下转型)
    添加删除Windows组件里没有IIS(Internet信息服务)项的解决方法
    Windows2003:“无法加载安装程序库wbemupgd.dll
  • 原文地址:https://www.cnblogs.com/liuxiaoqing1/p/12105974.html
Copyright © 2011-2022 走看看