P = 80
# Create Parameters
-model.addParameter(part, "L", L)
-model.addParameter(part, "E", E)
-model.addParameter(part, "P", P)
+model.addParameter(part, "L", str(L))
+model.addParameter(part, "E", str(E))
+model.addParameter(part, "P", str(P))
def vertical_body():
# Create YOZ sketch
points = [(P - 20, 16 + 16 / 2), (P - 20, 16), (P - 20, 16 + 16)]
points = [(p[0], -p[1]) for p in points] # as we look to back of the face
center, start, end = [geom.Pnt2d(*p) for p in points]
- arc = sketch.addArc(center, start, end, inversed=True)
+ arc = sketch.addArc(center, start, end, True)
# Set Auxiliarity
v1.setAuxiliary(True)
points = [(l + r, H), (l + 2 * r, H), (l, H)]
points = [(p[0], -p[1]) for p in points] # as we look to back of the face
center, start, end = [geom.Pnt2d(*p) for p in points]
- arc = sketch.addArc(center, start, end)
+ arc = sketch.addArc(center, start, end, False)
# Set Auxiliarity
top_middle.setAuxiliary(True)
b1 = vertical_body()
b2 = bottom_body()
-boolean = model.addAddition(part, b1.result() + b2.result())
+boolean = model.addFuse(part, b1.result() + b2.result())
model.do()
b3 = body_3()
-boolean = model.addAddition(part, boolean.result() + b3.result())
+boolean = model.addFuse(part, boolean.result() + b3.result())
model.do()
# START DEBUG PURPOSES
# END DEBUG PURPOSES
b4 = body_4()
-boolean = model.addAddition(part, boolean.result() + b4.result())
-model.do()
+boolean = model.addFuse(part, boolean.result() + b4.result())
+model.end()
std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(const ModelHighAPI_Selection & theExternal)
{
std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
- return LinePtr(new SketchAPI_Line(aFeature, theExternal));
+ LinePtr aLine(new SketchAPI_Line(aFeature, theExternal));
+ setRigid(InterfacePtr(aLine));
+ return aLine;
}
std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(const std::string & theExternalName)
{
- // TODO(spo): Add constraint SketchConstraintRigid like in PythonAPI. Is it necessary?
std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
- return LinePtr(new SketchAPI_Line(aFeature, theExternalName));
+ LinePtr aLine(new SketchAPI_Line(aFeature, theExternalName));
+ setRigid(InterfacePtr(aLine));
+ return aLine;
}
//--------------------------------------------------------------------------------------