What's new

Sketch Rectangle whith script

Cator

Senior Member
Hello everybody,
I want to create a rectangle, which I will then use to extrude material on the face at the ZX plane using the script, as in the "Laterale" Part. Can anyone help me please complete the script I made to do this part to add the extrusion? Thanks to all of you!
 

Attachments

  • laterale.py
    286 bytes · Views: 12
  • Laterale.AD_PRT
    258 KB · Views: 6

idslk

Alibre Super User
Hello Cator,

is this want you want to get?
Code:
Units.Current = UnitTypes.Millimeters
Laterale = Part("Laterale")
Sketch1 = Laterale.AddSketch("Sketch1", Laterale.XYPlane)
Sketch1.AddRectangle(0 , 0 , 190 , 210 , False)
Spessore_compensato = Laterale.AddExtrudeBoss("Compensato", Sketch1 ,4 , False)
Sketch2 = Laterale.AddSketch("Sketch2", Laterale.ZXPlane)
Sketch2.AddRectangle(80 , -2 , 84, -4 , False)
Spessore_compensato_2 = Laterale.AddExtrudeCut("Compensato2", Sketch2 ,210 , False)

Regards
Stefan
 

Cator

Senior Member
Yes Stefan,
Thanks
.I have many problem when inser the data point in AddRectangle...You can explain me the Logical of the number (80,-2,84,-4, False)?
 

albie0803

Alibre Super User
From the reference manual:

.AddRectangle(BottomLeftX , BottomLeftY , TopRightX, TopRightY , IsReference)
.AddRectangle(80 , -2 , 84, -4 , False)
Parameters
BottomLeftX X coordinate of bottom left corner
BottomLeftY Y coordinate of bottom left corner
TopRightX X coordinate of top right
TopRightY Y coordinate of top right
IsReference True to create a reference rectangle
 
Top