iCAx开思工具箱

标题: 该函数的用法UF_MODL_replace_features [打印本页]

作者: my_dear2002    时间: 2008-6-25 11:27
标题: 该函数的用法UF_MODL_replace_features
问题描述:
现在画两条线,将其中一条拉伸成面,然后进行如下操作:用未拉伸的线去替换拉伸的线,并使得拉伸的面也移动到未拉伸的线出,也就是子特征也拷贝过去,我用上面的函数UF_MODL_replace_features操作发现拉伸特征并没有拷贝过去,单步调试发现返回值不为0,最后一个参数n_parent_map为巨大的负数,看了英文帮助发现有点难懂,遂请大侠帮忙看看如何实现我的功能单靠这个函数是否能实现,如果能我的参数设置是不是错误了,错在哪儿?
代码:
        UF_MODL_replace_features_t *replm_map=NULL;//帮助写可为输入/输出参数,我作为输入,不知道正确与否
        int n_replm_map;//
        errorCode = UF_MODL_replace_features(&first_element,1,&second_element,1,true,true,&replm_map,&n_replm_map);

函数注释:(小弟英文水平和理解力有限请大侠帮忙)
This function replaces the features in original_features[] by the
features in replacement_features[] or the copies of features in
replacement_features[] if original_features[] are features on bodies,
curve features and datum features. The children of the original_features[]
will be reparented to the replacement_features[] or copies.

The original features will be deleted.

original_features[] can contain: features on the same body, curve features,
datum plane and datum axis features.

replacement_features[] must contain: features on other bodies (if
original_features[] contains features on a body), other curve features
(if original_features[] contains curve features) and other datum plane
and other datum axis features (if original_features[] contains datum plane
or datum axis features).

Note that original_features[] and replacement_features[] must contain
features that are in the same part file. Also, for features on a body, the
parents of each of the features in replacement_features[] must be either
another feature in the replacement_features[] or must be a feature which
is before the earliest feature in the original_features[].

parent_map[] maps entities created by the original_features[] to the
corresponding entities on the replacement_features[]. In addition to the
original_features[] and replacement_features[] you will have to provide a map
of edges and faces on the original_features[] to the corresponding edges and
faces of the replacement_features[].

You will specify the map as a array of objects of type
UF_MODL_replace_features_t described below. The children of the
original_features[] will be reparented to copies of the corresponding
entities on the replacement_features[] that are specified in the parent_map[].

Calling this function with return_map as true does not perform the replacement
but returns a parent_map[] each of whose original_entity elements are edges
and faces created by original_features[]. Only those edges and faces that are
parents of downstream features are returned in the parent_map[]. The
replacement_entity elements of all the structures in the parent_map[] are 0.
You will have to assign the appropriate replacement_entity for each of
the structures returned in the parent_map[] before calling this function with
return_map as false to perform the actual replace.
参数示意:
tag_t *original_featuresInputArray of features to replace
intn_original_featuresInputnumber of original_features
tag_t *replacement_featuresInputArray of replacement features
intn_replm_featuresInputnumber of replacement_features
logicalreturn_mapInputreturn_map = true - return in
parent_map[] the edges and faces created
by the original_features[] which have to
be mapped to the corresponding edges and
faces on the replacement_features[]
return_map = false - perform the replace
logicaluse_copy_of_replacementInputuse_copy_of_replacement = false -
Use the replacement features directly to
replace the original features
use_copy_of_replacement = true - Copy
the replacement features and use the copy
of the replacement feature to replace the
original features
UF_MODL_replace_features_t * *parent_mapInput / OutputMap of edges and faces
created by the
original_features[] to
corresponding edges and faces
on the replacement_features[]
int *n_parent_mapInput / Outputnumber of elements in (parent_map)[]

作者: my_dear2002    时间: 2008-6-25 12:06
实现功能动画如图所示:




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3