- 积分
- 3
- 注册时间
- 2008-4-30
- 仿真币
-
- 最后登录
- 1970-1-1
|
这个是帮助里面的例子,但运行后发现只能对末更新的视图进行设置,
不能对己更新好的视图进行设置,不知道那位知道否!多谢
/*
* The code in the following example sets the view display preference for
* the member view in the drawing. For simplicity, it assumes that the
* drawing units are English.
*/
#include <stdio.h>
#include <uf.h>
#include <uf_draw.h>
#include <uf_draw_types.h>
#include <uf_obj.h>
#include <uf_view.h>
void ufusr(char *param, int *retcod, int param_len)
{
char drawing_name [30] = "";
char view_name [30] = "";
char error_message[133] = "";
tag_t view_tag = NULL_TAG;
int ifail = 0;
UF_DRAW_view_prfs_t view_display_parms;
ifail = UF_initialize();
if (!ifail)
{
/* get the name of the first drawing. */
ifail = uc6492 (drawing_name);
}
if (!ifail)
{
/* get the name of the drawing's first view. */
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)
{
/* LWAYS retrieve the view's current display parameter
settings before changing them.A
*/
ifail = UF_DRAW_ask_view_display (view_tag,
&view_display_parms);
}
if (!ifail)
{
/* change the view's display parameters */
view_display_parms.hidden_line =
UF_DRAW_hidden_line_removal_off;
view_display_parms.hidden_line_color = UF_OBJ_BLUE;
view_display_parms.hidden_line_font = UF_OBJ_FONT_DOTTED;
view_display_parms.hidden_line_width =
UF_OBJ_WIDTH_NORMAL;
view_display_parms.edge_hiding_edge =
UF_DRAW_edge_hiding_edge_off;
view_display_parms.silhouettes = UF_DRAW_silhouettes_on;
view_display_parms.uvhatch = UF_DRAW_uvhatch_off;
view_display_parms.smooth = UF_DRAW_smooth_on;
view_display_parms.smooth_edge_color = UF_OBJ_BLUE;
view_display_parms.smooth_edge_font = UF_OBJ_FONT_DASHED;
view_display_parms.smooth_edge_width =
UF_OBJ_WIDTH_NORMAL;
view_display_parms.smooth_edge_gap = UF_DRAW_gap_on;
view_display_parms.smooth_edge_gap_size = 0.1;
view_display_parms.virtual_intersect =
UF_DRAW_virtual_intersect_on;
view_display_parms.virtual_intersect_color = UF_OBJ_CYAN;
view_display_parms.virtual_intersect_font =
UF_OBJ_FONT_DASHED;
view_display_parms.virtual_intersect_width =
UF_OBJ_WIDTH_NORMAL;
view_display_parms.tolerance = 0.0001;
ifail = UF_DRAW_set_view_display (view_tag,
&view_display_parms);
}
printf ("UF_DRAW_set_view_display 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();
} |
评分
-
1
查看全部评分
-
|