UG KF 二次开发 nx_askArcLength()函数报错
目的 选择曲线 计算线长,nx_askArcLength()总是报错,帮看下代码 哪里错了!! 感谢!(child) slect:
{
Class, %ui_comp_group;
title, "选择激光切割线测量线长";
Members, {len:};
};
(Child) len:
{
Class, %ui_comp_selection;
many, true;
SnapPointOverlay, false;
SoUpdateOption, 3;
Label, "选择曲线";
Tooltip, "选择激光切割曲线";
Scope, 1;
FilterTriple, {{3,0,0},{5,0,0},{9,0,0}};
SelectedObjects, {};
};
#计算曲线长度
#(Number) lenth1: ug_curve_askArcLength(any,len:);
(Number) lenth1: nx_askArcLength(len:SelectedObjects:);
报错信息:
ug_curve_askarclength() failed : input isneither an edge nor a curve
rule:
函数: nx_askArcLength
描述: Returns the length of a given Curve/Edge
参数: curve (Any) Specify a curve
返回: (Number)- The length of a curve/edge
---
Returns the length of a given Curve/Edge 选择类:
DefClass: %ui_comp_selection (%ui_comp);
#+
Single/Multiple selection control
Single select = False;
Multiple select = True;
#-
(Canonical boolean Parameter Modifiable) Many: true;
#+
SnapPointOverlay
This attribute allows the addition of point creation to
this selection component. If set to true, you have the option
of either selecting an existing object and/or creating a new point.
The point created will be added to the selectedObject list.
#-
(Canonical boolean Parameter Modifiable) SnapPointOverlay: false;
#+
SoUpdateOption
Smart Object Update Option
This attribute controls the update behavior of a point created
by using the SnapPointOverlay option.
UF_SO_dont_update = 0
UF_SO_update_within_modeling = 1
UF_SO_update_after_modeling = 2
UF_SO_update_after_parent_body = 3
#-
(Canonical integerParameter Modifiable) SoUpdateOption: 3;
#+
The text for label
#-
(Canonical stringParameter Modifiable) Label: "Select Objects";
#+
The text for tooltip
#-
(Canonical stringParameter Modifiable) Tooltip: "Select Objects";
#+
Scope
Controls the selection scope for the object
UF_UI_SEL_SCOPE_WORK_PART 1 Allows you to select only objects
which belong to the work part.
This includes immediate
components of the work part. If
you select an object occurrence,
the prototype is returned.
UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY3 Allows you to select any object
or object occurrence in the
assembly. No scope restrictions
are applied.
UF_UI_SEL_SCOPE_WORK_PART_AND_OCC 4 Allows you to select objects
which belong to the work part or
its subassembly. If you select
an object occurrence, the
prototype is returned.
UF_UI_SEL_SCOPE_WORK_PART_AND_WP_OCC 5Allows you to select objects
which belong to the work part or
its subassembly. If you select
an object occurrence, the
occurrence of the work part is returned.
#-
(Canonical integerParameter Modifiable) Scope: 1;
#+
The triple are a list of list in the format of {{type1, subtype1, feature_type1},
{type2, subtype2, feature_type2} ...}
type; - This can be one of the object types that are listed in
uf_object_types.h
subtype; - This can either be UF_all_subtype, or a proper
subtype of the object type selected
feature_type; - This is only meaningful when the object_type is
UF_solid_type.In that case, this should be set to
one of the solid feature type constants in uf_ui_types.h:
FEATURE_ANY_EDGE 1
FEATURE_LINEAR_EDGE 2
FEATURE_CIRCULAR_EDGE 3
FEATURE_ELLIPTICAL_EDGE 4
FEATURE_INTERSECTION_EDGE 5
FEATURE_BCURVE_EDGE 6
FEATURE_SPCURVE_EDGE 7
FEATURE_FOREIGN_EDGE 8
FEATURE_CNST_PARM_EDGE 9
FEATURE_ANY_WIRE_OR_EDGE 10
FEATURE_ANY_FACE 20
FEATURE_PLANAR_FACE 21
FEATURE_CYLINDRICAL_FACE 22
FEATURE_CONICAL_FACE 23
FEATURE_SPHERICAL_FACE 24
FEATURE_TOROIDAL_FACE 25
FEATURE_PARAMETRIC_FACE 26
FEATURE_BLENDING_FACE 27
FEATURE_OFFSET_FACE 28
FEATURE_SWEPT_FACE 29
FEATURE_SWUNG_FACE 30
FEATURE_FOREIGN_FACE 31
FEATURE_ANY_COMPOSITE_BODY 32
FEATURE_ANY_COMPOSITE_FACE 33
FEATURE_ANY_COMPOSITE_EDGE 34
FEATURE_SHEET_BODY 35
FEATURE_SOLID_BODY 36
For example, to enable selection of only elliptical edges and spherical faces of solids,
the list would be:
{
{ 70, 2, 24 }, #Spherical faces
{ 70, 3,4 } #Elliptical edges
}
#-
(Canonical listParameter Modifiable) FilterTriple: {};
#+
The list of selected objects
#-
(Canonical List Parameter Modifiable) SelectedObjects: {};
#+ @deprecated SelectedObject
please use SelectedObjects
#-
(Canonical List Parameter Modifiable) SelectedObject: SelectedObjects: ;
#+
The coordinates of the last pick point
#-
(Point modifiable ) PickPoint: point(0,0,0);
#+
The view of the last pick point
#-
(Any modifiable ) PickView: ;
(String) ClassName: "UGS::UI::Comp::KFselectObject";
页:
[1]