請參考以下程式範例,此程式已驗證
#! UGNX/KF 2.0
DefClass: xn_odbc(ug_base_part);
(String Parameter Modifiable) DSN: "Blade Point Data";
(List) SQL: {"SELECT X, Y, Z From Section_A",
"SELECT X, Y, Z From Section_B",
"SELECT X, Y, Z From Section_C",
"SELECT X, Y, Z From Section_D",
"SELECT X, Y, Z From Section_E"};
(child) DB: {
Class, ug_odbc_Database;
dsn, DSN:;
};
(child list) RS: {
Class, ug_odbc_Recordset;
Quantity, Length(SQL;
database, DB:;
SQLstatement, nth(Child:Index:, SQL;
};
(Instance Modifiable) TMP: First(RS;
(child list) SPL: {
Class, ug_spline_thru;
Quantity, Length(SQL;
Degree, 3;
Periodic?, TRUE;
Points, @{
StoreValue(nth(Child:Index:, RS, self:, TMP);
TMP:MoveFirst);
Loop {
For $ctr from 1 to 200;
For $d is TMP:GetRecord);
For $n is TMP:MoveNext);
Collect {Point(First($d), Second($d), Third($d))};
};
};
};
(child) Blade: {
Class, ug_thru_curve;
section, loop{
For $num from 1 to Length(SQL:);
collect {forward,nth($num,SPL:)};
};
Degree, 3;
Body_Type, solid;
}; |