Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Data Type Error (NX/KF)

ranjithvc

New member
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
 
Hi Ranjith :<?:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" />
Go through Below codes u'll understand the problem. If you are facing any problem feel free to ask
#! NX/KF 5.0
DefClass: New_Class_Name (ug_base_part);
(Number Modifiable Parameter) Q: 2;
(Number Modifiable Parameter) V: 10;
(Number Modifiable Parameter) P: 10;
(Number Modifiable Parameter) D: 10;
(Number Modifiable Parameter) P01: V:;
(Number Modifiable Parameter) P02: P01:+P:;
(Number Modifiable Parameter) P03: P02:+P:;
(Number Modifiable Parameter) P04: P03:+P:;
(Number Modifiable Parameter) P05: P04:+P:;
(List Modifiable Parameter) Pitch1: Loop
{
For $x from 1 to V:;
For $list is loop
{
For $a from 1 to V:;
For $c Is ($a + P:);
For $d Is ($a + $c);
append {$x,$d};
};
append $list;
};
(Child List) cy: {
Class, ug_cylinder;
quantity, floor(Q:);
Diameter, d:;
Height, d:;
Origin, Point(Child:Index:-1+nth(Child:Index:,Pitch1:),0,D:/2);
Direction, Vector(0,1,0);
};
 

Sponsor

Articles From 3DCAD World

Back
Top