Hi!
Corpus 6.2.100.205
I made a makro added to the front and to give raster 32 holes on the sides as long as the height of the front..but I have a problem and I can’t solve it
when one of the sides is above the bottom,the holes move higher than the side that is at the same level with the bottom
How do I identify the elements in the macro, or what would be the solution?
thanks!
I hope it is understood in the video what I mean
Try this. Do not use Connect inside Joint. Use JX, JY, JZ to detect Obj2.
JX, JY, JZ is the location of a point inside Object2 measured from 0,0,0 of Obj1.
Once you have defined what Obj2 is, you can make holes on, for example, side 2 or 3 of Obj2.
(You can make holes on sides 4 and 5 once you know what Obj2 is.)
When calculating, you can say: If Obj2.y < Obj1.y then…
Then make another Macro for the right side.
Let’s say you want to find a point 30mm from the top of the front on the sides of the element.
GY for the left Obj2 would be…
GY = (obj1.aabb.ymax – obj2.y) – 30
and for
GY for the right Obj2 would be…
GY = (obj1.aabb.ymax – obj2.y) – 30
I didn’t test this. Just presenting the logic I would use
[VARIJABLE]
LEFT_SIDE_PERF=1
RIGHT_SIDE_PERF=1
Perforations_Depth=12
Perforations_Diameter=5
[FORMULE]
//evar=catuta variabila din parent to parent
front=parent.obj1.y
fund=obj2.y
AdSe=parent.Tandem_BMotion.depth
B_Jos=front-fund+parent.Tandem_BMotion.y+36
B_Sus=evar.Up_Distance
Front_Dist=37
Nr_G_32=round((v-B_Jos-B_Sus)/32+0.5)
Lungime_perforata=Nr_G_32*32
only_vert_sides=if(obj2.smjer=0;1;0)
Vert_gap=ydelta
gap_x=x
[JOINT]
JX=0
JY=front
JZ=-10
//********************** Left ************************************
[RASTER1]
J=1
GB=if((obj2.x<=x) and (LEFT_SIDE_PERF=1);Nr_G_32;0)*only_vert_sides
GN=******** Perforatii 32 in Fata *********
GD=Perforations_Depth
GF=Perforations_Diameter
GX=Front_Dist
GY=B_Jos
GS=1
GK=0
GP=0
GR=32
[RASTER2]
J=1
GB=if((obj2.x<=x) and (LEFT_SIDE_PERF=1);Nr_G_32;0)*only_vert_sides
GN=******** Perforatii 32 in Centru *********
GD=Perforations_Depth
GF=Perforations_Diameter
GX=if(AdSe=250;Front_Dist+160;if(AdSe=270;Front_Dist+160;if(AdSe=300;Front_Dist+224;if(AdSe=350;Front_Dist+224;if(AdSe=400;Front_Dist+192;if(AdSe=450;Front_Dist+224;if(AdSe=500;Front_Dist+224;if(AdSe=550;Front_Dist+224;if(AdSe=600;Front_Dist+224;0)))))))))
GY=B_Jos
GS=1
GK=0
GP=0
GR=32
No, you have to write two rasters for two passes.
By the way, I noticed one IF that is too long and hard to follow and maintain. There is a simpler way to write multiple IFs.
1. Instead of GX=If(AdSe=250;Front_Dist… write
GX=X_pos
(X_pos is a variable, you can give it another name)
2. In the [FORMULA] section write
X_pos=if(AdSe=250;Front_Dist+160;XP2)
XP2=if(AdSe=270;Front_Dist+160;XP3)
XP3=if(AdSe=300;Front_Dist+224;XP4)
XP4=if(AdSe=350;Front_Dist+224;XP5)
XP5=if(AdSe=400;Front_Dist+192;XP6)
XP6=if(AdSe=450;Front_Dist+224;XP7)
XP7=if(AdSe=500;Front_Dist+224;XP8)
XP8=if(AdSe=550;Front_Dist+224;XP9)
XP9=if(AdSe=600;Front_Dist+224;0)
I used 2 macros for each side..can I do “jx” in a single macro to drill both side holes?
https://streamable.com/vw6u2y