idslk
Alibre Super User
I am struggleling with the AddRectangle function (seems to be the same with AddCircle...)
If i use the same values for x and y for the three basic plane i do not know from where the are measured (i assume from the origin) and in wich direction they count.
The script creates 3 cuboid and 3 cylinder. Each cylinder is only to show the position of the lower left corner for the AddRectangle call.
The behaviar of the z-axis (zx-plane) is not like i expected. The extrusion seems to work ok but the position coordinates seem to be multiplied with -1.
Am i doing something wrong?
Does anyone have an explanation for me?
Thanks in advance
Stefan
If i use the same values for x and y for the three basic plane i do not know from where the are measured (i assume from the origin) and in wich direction they count.
The script creates 3 cuboid and 3 cylinder. Each cylinder is only to show the position of the lower left corner for the AddRectangle call.
Code:
# Rectangle-Test
# ...
Win = Windows()
ScriptName = 'Rectangle-Test'
#If Existing Part should be modified
CP = CurrentPart()
CPText= CP.Name
#Extrudelength
EL = 5
#Rectangle Data
P1_X = 5
P1_Y = 10
P2_X = 15
P2_Y = 30
#Circle Data for Cylinder on bottom-left of rectangle
P3_X = P1_X-1
P3_Y = P1_Y-1
DIA = 1
#Use FS1 = 'XY-Plane' at english install of AD
FS1 = 'XY-Ebene'
RE1 = CP.AddSketch('SketchXY', CP.GetPlane(FS1))
RE1.AddRectangle(P1_X, P1_Y, P2_X, P2_Y, False)
RE1.AddCircle(P3_X, P3_Y, DIA, False)
# extrude into a cuboid and cylinder
CP.AddExtrudeBoss('Quader1', RE1, EL, False)
FS2 = 'ZX-Ebene'
RE2 = CP.AddSketch('SketchZX', CP.GetPlane(FS2))
RE2.AddRectangle(P1_X, P1_Y, P2_X, P2_Y, False)
RE2.AddCircle(P3_X, P3_Y, DIA, False)
# extrude into a cuboid and cylinder
CP.AddExtrudeBoss('Quader2', RE2, EL, False)
FS3 = 'YZ-Ebene'
RE3 = CP.AddSketch('SketchYZ', CP.GetPlane(FS3))
RE3.AddRectangle(P1_X, P1_Y, P2_X, P2_Y, False)
RE3.AddCircle(P3_X, P3_Y, DIA, False)
# extrude into a cuboid and cylinder
CP.AddExtrudeBoss('Quader3', RE3, EL, False)
The behaviar of the z-axis (zx-plane) is not like i expected. The extrusion seems to work ok but the position coordinates seem to be multiplied with -1.
Am i doing something wrong?
Does anyone have an explanation for me?
Thanks in advance
Stefan