2009-10-13 02:10 PM
2009-10-30 05:41 PM
f1= "ARMDATA.txt" ch1 = open ("TEXT", f1, "separator = 'K'; mode = ro,LIBRARY" ) n = input (ch1, 1, 1,dummy, xOffset,yOffset,height,zRotAng,var5,var6) i = 1 while n > 2 do sum = xOffset+yOffset+height+zRotAng+var5+var6 IF sum=6 THEN i = i+1 n = input (ch1, i, 1, dummy, nRows) FOR j=1 TO nRows i = i+1 n = input (ch1, i, 1, dummy,offset,height) ADDX offset/1000 ROTZ -90 CYLIND height,0.006 DEL 2 NEXT j ELSE ADDX xOffset/1000 ADDY yOffset/1000 if zRotAng <> 0 then ROTZ zRotAng else if yOffset<>var6 then ROTZ 90 else rotz 0 endif endif ROTY 90 CYLIND height/1000,0.006 DEL 4 LIN_ xOffset/1000,yOffset/1000,0, var5/1000,var6/1000, 0 ENDIF i = i+1 n = input (ch1, i, 1, dummy,xOffset,yOffset,height,zRotAng,var5,var6) endwhile close ch1One more advice: you should separate the two kinds of data into two data files. You don't have to go the tricky way to mark the border between them.
2009-11-15 07:52 PM
!--> file names added f1= "ARMDATA.txt" ch1 = open ("TEXT", f1, "separator = 'K'; mode = ro,LIBRARY" ) n = input (ch1, 1, 1,dummy, var1,var2,var3,var4,var5,var6) hight = var1 step1 = var2 FOR j1=1 TO step1 ADDZ -200 i = 1 while n > 2 do sum=var1+var2+var3+var4+var5+var6 IF sum=6 THEN i = i+1 n = input (ch1, i, 1, dummy,var7) FOR j=1 TO var7 i = i+1 n = input (ch1, i, 1, dummy,var8,var9) ADDX var9/1000 ROTZ -90 ROTY 90 CYLIND var8,0.006 DEL 3 NEXT j ELSE ADDX var1/1000 ADDY var2/1000 if var4 <> 0 then ROTZ var4 else if var2<>var6 then ROTZ 90 else rotz 0 endif endif ROTY 90 CYLIND var3/1000,0.006 DEL 4 LINE2 var1/1000,var2/1000,var5/1000,var6/1000 ENDIF i = i+1 n = input (ch1, i, 1, dummy,var1,var2,var3,var4,var5,var6) endwhile NEXT j1 close ch1text file:
2009-11-16 12:43 PM
2009-11-16 04:02 PM
ztaskai wrote:A figure appears in the loop (while endwhile). I want to draw that figure with displacement on the axis Z
Yourforloop doesn't do anything since the inner whileloop processes the whole file.
I still don't get what you're doing...
Regs,
Zsolt
2009-11-17 10:47 PM