|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
/*
The code in the following example modifies the scale of a drawing
member view.
*/
#include <stdio.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_draw.h>
#include <uf_draw_types.h>
#include <uf_modl.h>
#include <uf_obj.h>
#include <uf_view.h>
void ufusr(char *param, int *retcod, int param_len)
{
char drawing_name [MAX_ENTITY_NAME_SIZE] = "SHT1";
char * view_name [MAX_ENTITY_NAME_SIZE] ={"[email=EF@2]EF@2","ER@3[/email]"};
char error_message[MAX_LINE_SIZE + 1] = "";
tag_t view_tag = NULL_TAG;
tag_t drawing_tag = NULL_TAG; // a1.这里的NULL_TAG 是什么意思?
int ifail = 0;
tag_t exp_tag = NULL_TAG;
double scale;
ifail = UF_initialize();
if (!ifail)
{
/* Get the tag of drawing. */
ifail = UF_DRAW_ask_current_drawing (&drawing_tag);
}
if (!ifail)
{
/* Get the name of first drawing. */
ifail = UF_OBJ_ask_name(drawing_tag, drawing_name); //2.这里的意思是 获取该图纸的名称吗?
}
if (!ifail)
{
/* Get the name of the drawing's first view. */ //3.如果我想同时修改三个视图的比例,该怎么写?
ifail = uc6499 (drawing_name, &view_name);
}
if (!ifail)
{
/* Get the view's tag. */
ifail = UF_VIEW_ask_tag_of_view_name (&view_name,
&view_tag);
}
if (!ifail)
{
ifail = UF_DRAW_ask_view_scale (view_tag, &exp_tag,&scale);
}
if (!ifail)
{
/* Set the parametric view scale. */
ifail = UF_DRAW_set_view_scale (view_tag, 2);
}
printf ("UF_DRAW_set_view_scale sample ");
if (ifail)
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails.\nError is: %s\n", error_message );
}
else
printf( "is successful.\n" );
UF_terminate();
}
本帖最后由 my-scarecrow 于 2009-11-30 09:49 编辑 |
|