uf二维工程图视图的复制与移动
#include <uf_defs.h>
#include <uf_draw.h>
#include <uf_obj.h>
#include <uf_part.h>
#include <uf_view.h>
/* TODO: Add your application code here */
int ifail = 0;
char drawing_name[30] = "";
char view_name [30] = "";
char error_message[133];
tag_t view_tag = NULL_TAG;
tag_t drawing_tag;
logical out_of_date;
ifail = UF_initialize();
if (!ifail)
{
/* 获得第一个图纸的名称 */
ifail = uc6497(drawing_name);
}
if (!ifail)
{
/* 更具图纸的名称获得图纸标识 */
ifail =uc5028(drawing_name,strlen(drawing_name),&drawing_tag);
}
if (!ifail)
{
/* 获得第一个视图名称*/
ifail = uc6499 (drawing_name, view_name);
}
if (!ifail)
{
/* 更具视图名称获得视图标识*/
ifail = UF_VIEW_ask_tag_of_view_name (view_name,
&view_tag);
}
if (!ifail)
{
tag_t view_taga = NULL_TAG;
ifail = UF_DRAW_copy_view( view_tag,&view_taga); //复制视图
double dwg_reference_pt[2] = {150.0, 150.5};
ifail = UF_DRAW_move_view( view_taga,dwg_reference_pt );//移动视图
}
//提示信息
if( ifail )
{
ifail = UF_get_fail_message( ifail, error_message );
uc1601( error_message,1 );
}
else if ( drawing_tag == NULL_TAG )
uc1601("图纸没有找到" ,1);
else
uc1601( "ok" ,1);
/* Terminate the API environment */
_____________________________________________________________________________ _
中磊UG二次开发教程 梅雷著 qq1821117007
学UG就上UG网 http://www.9sug.com/ |