mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
Merge branch 'listofshapes_property_setter' into 'master'
Add properties .name and .maxh to ListOfShapes See merge request jschoeberl/netgen!404
This commit is contained in:
commit
6fa47a2a6e
@ -1422,6 +1422,28 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
}
|
||||
return CastShape(maxshape);
|
||||
})
|
||||
.def_property("name", [](ListOfShapes& shapes)
|
||||
{
|
||||
throw Exception("Cannot get property of ListOfShapes, get the property from individual shapes!");
|
||||
},
|
||||
[](ListOfShapes& shapes, std::string name)
|
||||
{
|
||||
for(auto& shape : shapes)
|
||||
{
|
||||
OCCGeometry::global_shape_properties[shape.TShape()].name = name;
|
||||
}
|
||||
})
|
||||
.def_property("maxh", [](ListOfShapes& shapes)
|
||||
{
|
||||
throw Exception("Cannot get property of ListOfShapes, get the property from individual shapes!");
|
||||
},
|
||||
[](ListOfShapes& shapes, double maxh)
|
||||
{
|
||||
for(auto& shape : shapes)
|
||||
{
|
||||
OCCGeometry::global_shape_properties[shape.TShape()].maxh = maxh;
|
||||
}
|
||||
})
|
||||
|
||||
;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user