NX二次开发 UFUN判断对象是否圆弧 UF_EVAL_is_arc 曲线和边缘都支持
//VS8.0+VS2010
#include <uf_curve.h>
#include <uf_obj.h>
#include <uf_modl.h>
#include <uf_eval.h>
//判断对象是否是圆弧
bool AskObjectIsArc(const tag_t tObject)
{
int type = 0, subtype = 0;
logical is_arc = false;
UF_EVAL_p_t evaluator = NULL;
UF_OBJ_ask_type_and_subtype(tObject, &type, &subtype);
if (UF_line_type == type ||
UF_solid_collection_type == type ||
UF_circle_type == type ||
UF_conic_type == type ||
UF_spcurve_type == type ||
UF_old_spline_type == type ||
UF_spline_type == type ||
UF_b_curve_b_spline_subtype == type ||
(UF_solid_type == type && UF_solid_edge_subtype == subtype))
{
if (UF_EVAL_initialize(tObject, &evaluator))
return false;
UF_EVAL_is_arc(evaluator, &is_arc);
UF_EVAL_free(evaluator);
evaluator = NULL;
}
return is_arc ? t