2010-01-14 04:05 AM
2010-01-27 11:29 AM
When you pass a parameter to objects, is a new memory holder used each time or is it the same one?That's a good question...
2010-01-27 07:10 PM
2010-12-13 04:09 PM
TEXT2 0,0, STR(fjmt_pc_n_h,8,3)+'-'+fjmt_pc_n_typeThe above works in the 2D script to display the dimension between elements and also the type. This shows that when the object is first placed the type array is not being filled with default values, but that these can be subsequently set and stored. Sometimes the type value seems to get passed to other array values when editing (e.g change to edit element 2 and this also edits element 3 type)
IF fjmt_pc_n_type='A' THEN fjmt_gen_rad=0.100 IF fjmt_pc_n_type='B' THEN fjmt_gen_rad=0.200 etcThe above IF statements do not work in the 3D Script to set the element radius as the element type parameter is not returning a value
2010-12-13 04:16 PM
!=========================================================================================== !MASTER SCRIPT eps = 0.00001 unID=1 IF GLOB_MODPAR_NAME = 'fjmt_pc_n_edit' THEN DIM temp1[] DIM temp2[] FOR i= 1 to fjmt_pc_n temp1 = 0.500 temp2 = 'XX' NEXT i IF fjmt_pc_n < fjmt_pc_n_prev THEN FOR i= 1 to fjmt_pc_n temp1 = fjmt_pc_n_h temp2 = fjmt_pc_n_type NEXT i ELSE FOR i= 1 to fjmt_pc_n_prev temp1 = fjmt_pc_n_h temp2 = fjmt_pc_n_type NEXT i ENDIF PARAMETERS fjmt_pc_n_h = temp1 : fjmt_pc_n_h = temp1 PARAMETERS fjmt_pc_n_type = temp2 : fjmt_pc_n_type = temp2 PARAMETERS fjmt_pc_n_prev = fjmt_pc_n : fjmt_pc_n_prev = fjmt_pc_n ENDIF !=========================================================================================== !PARAMETER SCRIPT VALUES 'fjmt_pc_n' RANGE [1,) VALUES 'fjmt_pc_n_type_f_edit' RANGE [1,4] VALUES 'fjmt_pc_n_type_edit' 'A','B','C','D' !------------------------------------------------------------------------------------------- !GET Panel Number Editors from Panel Number Array Values IF GLOB_MODPAR_NAME = "fjmt_pc_n_edit" THEN PARAMETERS fjmt_pc_n_h_edit = fjmt_pc_n_h[fjmt_pc_n_edit] : fjmt_pc_n_h_edit = fjmt_pc_n_h[fjmt_pc_n_edit] PARAMETERS fjmt_pc_n_type_edit = fjmt_pc_n_type[fjmt_pc_n_edit] : fjmt_pc_n_type_edit = fjmt_pc_n_type[fjmt_pc_n_edit] ENDIF !------------------------------------------------------------------------------------------- !PUT Panel Number Editors to Panel Number Arrays IF GLOB_MODPAR_NAME = "fjmt_pc_n_h_edit" THEN PARAMETERS fjmt_pc_n_h[fjmt_pc_n_edit] = fjmt_pc_n_h_edit : fjmt_pc_n_h[fjmt_pc_n_edit] = fjmt_pc_n_h_edit ELSE fjmt_pc_n_h_edit = fjmt_pc_n_h[fjmt_pc_n_edit] PARAMETERS fjmt_pc_n_h_edit = fjmt_pc_n_h_edit ENDIF IF GLOB_MODPAR_NAME = "fjmt_pc_n_type_edit" THEN PARAMETERS fjmt_pc_n_type[fjmt_pc_n_edit] = fjmt_pc_n_type_edit : fjmt_pc_n_type[fjmt_pc_n_edit] = fjmt_pc_n_type_edit ELSE fjmt_pc_n_type_edit = fjmt_pc_n_type[fjmt_pc_n_edit] PARAMETERS fjmt_pc_n_type_edit = fjmt_pc_n_type_edit ENDIF !------------------------------------------------------------------------------------------- !Set & Get Number of Panels for Panel Count FOR i = 1 TO fjmt_pc_n PUT i NEXT i VALUES 'fjmt_pc_n_edit' GET (fjmt_pc_n) !=========================================================================================== !2D SCRIPT PEN 1 HOTSPOT2 0,0 FOR i=1 TO fjmt_pc_n HOTSPOT2 0,0 TEXT2 0,0, STR(fjmt_pc_n_h,8,3)+'-'+fjmt_pc_n_type ADD2 0,fjmt_pc_n_h NEXT i DEL i-1 PROJECT2 3,270,2 !=========================================================================================== !3D SCRIPT HOTSPOT 0, 0, 0 HOTSPOT A, 0, 0 FOR i=1 TO fjmt_pc_n HOTSPOT 0, 0, 0, unID, fjmt_pc_n_h, 1+128 : unID = unID +1 !Base HOTSPOT 0, 0, fjmt_pc_n_h, unID, fjmt_pc_n_h, 2 : unID = unID +1 !Moving HOTSPOT 0, 0, -1, unID, fjmt_pc_n_h, 3 : unID = unID +1 !Reference ADDx A HOTSPOT 0, 0, 0, unID, fjmt_pc_n_h, 1+128 : unID = unID +1 !Base HOTSPOT 0, 0, fjmt_pc_n_h, unID, fjmt_pc_n_h, 2 : unID = unID +1 !Moving HOTSPOT 0, 0, -1, unID, fjmt_pc_n_h, 3 : unID = unID +1 !Reference DEL 1 ADD 0, 0, fjmt_pc_n_h GOSUB 1: !fjmt_pc_n_type_f NEXT i DEL i-1 !------------------------------------------------------------------------------------------- END !End of 3D Script !=========================================================================================== !SUBROUTINES !=========================================================================================== !------------------------------------------------------------------------------------------- 1: !Louvre fjmt_gen_mat1=1 fjmt_gen_mat2=1 fjmt_gen_w1=A IF fjmt_pc_n_type='A' THEN fjmt_gen_rad=0.100 IF fjmt_pc_n_type='B' THEN fjmt_gen_rad=0.200 IF fjmt_pc_n_type='C' THEN fjmt_gen_rad=0.500 IF fjmt_pc_n_type='D' THEN fjmt_gen_rad=0.750 ROTz -90 ROTx 90 MATERIAL fjmt_gen_mat1 CYLIND -fjmt_gen_w1, fjmt_gen_rad DEL 2 RETURN