We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2015-10-06 02:41 PM
pen gs_cont_pen aa=0.3466! this is the actual width of the original zz=0.4041!this is the actual height of the original n1=round_int(a/aa)!divide A by the original width to get a round number n2=round_int(zzyzx/zz)!divide ZZYZX by original height to get a round number aaa=a/n1!this should calculate the new width of element zzz=zzyzx/n2!this should calculate the new height of element for herh2 = 1 to n2 !repeat vertical for herh1 = 1 to n1 !repeat horizontal MULX aa/aaa!adjust width to new width MULZ zz/zzz!adjust heigh to new height !! here are all the LIN_ statements for my shape for sake of simplicity, one line LIN_ 0,0,0, 0.3466,0,0.4041 addx aaa !move in x direction next herh1 del n1 addz zzz !move in y direction next herh2Does anyone know where I've made a mistake in the code?
2015-10-08 04:36 PM
pen gs_cont_pen aa=0.3466! this is the actual width of the original zz=0.4041!this is the actual height of the original n1=round_int(a/aa)!divide A by the original width to get a round number n2=round_int(zzyzx/zz)!divide ZZYZX by original height to get a round number aaa=a/n1!this should calculate the new width of element zzz=zzyzx/n2!this should calculate the new height of element MULX aa/aaa!adjust width to new width MULZ zz/zzz!adjust heigh to new height for herh2 = 1 to n2 !repeat vertical for herh1 = 1 to n1 !repeat horizontal !! here are all the LIN_ statements for my shape for sake of simplicity, one line BODY -1 LIN_ 0,0,0, 0,0,zz LIN_ 0,0,0, aa,0,0 addx aa !move in x direction next herh1 del n1 addz zz !move in y direction next herh2Small modification, but it still doesn't work like I want it to.