|
我现在想要删除二维工程图中的一些note文字!我想的大概过程是先通过遍历出所有的文本,然后判断文本位置坐标确定是否是需要删除的内容! 但是现在操作过程中遍历部分遇到困难,希望高手指教一下!
$ z% Z& N- H2 F+ I 我现在是这样的:
0 _9 O% D( i( [! `/ `ifail = UF_OBJ_cycle_objs_in_part( UF_PART_ask_display_part(),- y9 f" b$ n$ i' w6 S
UF_drafting_entity_type,¬e_tag );
( M8 _ F1 y0 P& O M2 Q6 ^: O/* Find the tag of a note. */* B( W7 R6 l: k( C
while( !ifail && note_tag )2 q/ v6 H8 U: h! a% `8 p/ m
{5 g' ?5 j2 o( P8 c1 p
ifail = UF_OBJ_ask_type_and_subtype(note_tag, &type, &subtype );
/ ~. N/ I2 ]3 h$ H/* Test type for the note. */8 G* q; X0 U# K2 v' m
if( !ifail && subtype == UF_draft_note_subtype )/ Z' L5 `7 A, l x- \
{
, w1 j# r' E+ a$ N/* Retrieve the note information. */
9 f6 D. c2 a$ U4 W UF_DRF_ask_ann_data(¬e_tag,search_mask,&cycle_flag,ann_data,&ann_data_type,& ?' a4 W5 t* K0 M2 x5 `
&ann_data_form,&num_segments,ann_origin,&radius_angle);2 ^, w8 [2 D0 w0 s( N8 h
uc5574(num_segments,ann_data,notetxt,&lengthsize,&txtlength);
, W; l" R, \: H: u uc1601(notetxt,1);) s2 b ?- v2 e5 p9 @
if (0<ann_origin[0] && ann_origin[0]<297)0 E) @: Z$ E. t* g# ]
{7 ^& g1 j7 _2 T
UF_OBJ_delete_object(note_tag);
2 A8 g( X! n* W9 K C } + S3 w+ c; n0 i) u$ v- C! f
}
1 ~& P2 |2 ^: \, `( v/* Find the tag of next drafting entity. */* g# g0 X; @! |% \4 V# V
if ( !ifail )
$ G9 C. E2 \- r7 y6 J ifail = UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(),
/ M3 @3 E w* ?. W- _% v* O3 A3 r UF_drafting_entity_type,¬e_tag );: h+ X6 e9 S3 L( w7 o. S; T1 i
}
0 R% D U/ u- q( ]1 p3 X这样遍历的结果是PART文件里所有的drawing工程图里的所有note文本!我需要是当前打开的这个工程图里的文本!所有请问如何得到note文本所在的工程图drawing名称,再判断它是否是当前打开的这个工程图 |
|