Hi All,
I wrote a small program for creating cylinders with particular pitch distance. To calculate the pitch distance, i have to create list and call the list inside the class cylinder:. While creating a list, i'm getting error of
"Datatype Error
Number was found where List was expected.
Rule:
Pitch1:
Loop......."
I have attached the code below. Can you tell me, what was the mistake i'm doing.
#! NX/KF 3.0
DefClass: dlfi (ug_base_part);
(Canonical Number Parameter Modifiable) Q: 2;
(Canonical Number Parameter Modifiable) V: 10;
(Canonical Number Parameter Modifiable) P: 10;
(Canonical Number Parameter Modifiable) D: 10;
(Canonical Number Parameter Modifiable) P01: V:;
(Canonical Number Parameter Modifiable) P02: P01:+P:;
(Canonical Number Parameter Modifiable) P03: P02:+P:;
(Canonical Number Parameter Modifiable) P04: P03:+P:;
(Canonical Number Parameter Modifiable) P05: P04:+P:;
#(List) Pitch1: { P01:, P02:, P03:, P04:, P05:};
(List Modifiable) Pitch1:
Loop
{
With $a Is V:;
With $x Is V:;
For $b In Q:;
For $c Is $a + P:;
For $a Is ($a + $c);
Collect {$x, $a} Into $d;
Return Is $d;
};
(Child List) cylinder: {
Quantity; Floor( Q
;
Class, ug_cylinder;
Diameter, D:; Height, D:;
Origin; Point(Child:Index:-1+nth(Child:Index:,Pitch1
,0,D:/2);
Direction, Vector(0,1,0);
};
Advance Thanks
Ranjith
I wrote a small program for creating cylinders with particular pitch distance. To calculate the pitch distance, i have to create list and call the list inside the class cylinder:. While creating a list, i'm getting error of
"Datatype Error
Number was found where List was expected.
Rule:
Pitch1:
Loop......."
I have attached the code below. Can you tell me, what was the mistake i'm doing.
#! NX/KF 3.0
DefClass: dlfi (ug_base_part);
(Canonical Number Parameter Modifiable) Q: 2;
(Canonical Number Parameter Modifiable) V: 10;
(Canonical Number Parameter Modifiable) P: 10;
(Canonical Number Parameter Modifiable) D: 10;
(Canonical Number Parameter Modifiable) P01: V:;
(Canonical Number Parameter Modifiable) P02: P01:+P:;
(Canonical Number Parameter Modifiable) P03: P02:+P:;
(Canonical Number Parameter Modifiable) P04: P03:+P:;
(Canonical Number Parameter Modifiable) P05: P04:+P:;
#(List) Pitch1: { P01:, P02:, P03:, P04:, P05:};
(List Modifiable) Pitch1:
Loop
{
With $a Is V:;
With $x Is V:;
For $b In Q:;
For $c Is $a + P:;
For $a Is ($a + $c);
Collect {$x, $a} Into $d;
Return Is $d;
};
(Child List) cylinder: {
Quantity; Floor( Q
Class, ug_cylinder;
Diameter, D:; Height, D:;
Origin; Point(Child:Index:-1+nth(Child:Index:,Pitch1
Direction, Vector(0,1,0);
};
Advance Thanks
Ranjith