Skip to content

Commit

Permalink
AddLine with attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
StudioWEngineers committed Dec 20, 2024
1 parent 7ffea42 commit 3884f01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/bindings/bnd_extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,13 @@ BND_UUID BND_ONXModel_ObjectTable::AddLine1(const ON_3dPoint& from, const ON_3dP
return ON_UUID_to_Binding(rc);
}

BND_UUID BND_ONXModel_ObjectTable::AddLine2(const ON_3dPoint& from, const ON_3dPoint& to, const BND_3dmObjectAttributes* attributes)
{
ON_LineCurve lc(from, to);
ON_UUID rc = Internal_ONX_Model_AddModelGeometry(m_model.get(), &lc, attributes);
return ON_UUID_to_Binding(rc);
}

BND_UUID BND_ONXModel_ObjectTable::AddPolyline1(const BND_Point3dList& points, const BND_3dmObjectAttributes* attributes)
{
ON_PolylineCurve plc(points.m_polyline);
Expand Down Expand Up @@ -1719,6 +1726,7 @@ void initExtensionsBindings(rh3dmpymodule& m)
.def("AddPoint", &BND_ONXModel_ObjectTable::AddPoint5, py::arg("point"), py::arg("attributes"))
.def("AddPointCloud", &BND_ONXModel_ObjectTable::AddPointCloud, py::arg("cloud"), py::arg("attributes")=nullptr)
.def("AddLine", &BND_ONXModel_ObjectTable::AddLine1, py::arg("from"), py::arg("to"))
.def("AddLine", &BND_ONXModel_ObjectTable::AddLine2, py::arg("from"), py::arg("to"), py::arg("attributes"))
.def("AddPolyline", &BND_ONXModel_ObjectTable::AddPolyline1, py::arg("polyline"), py::arg("attributes")=nullptr)
.def("AddPolyline", &BND_ONXModel_ObjectTable::AddPolyline2, py::arg("polyline"), py::arg("attributes")=nullptr)
.def("AddArc", &BND_ONXModel_ObjectTable::AddArc, py::arg("arc"), py::arg("attributes")=nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/bnd_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BND_ONXModel_ObjectTable
//Guid AddAngularDimension1(AngularDimension dimension)
//Guid AddAngularDimension2(AngularDimension dimension, ObjectAttributes attributes)
BND_UUID AddLine1(const ON_3dPoint& from, const ON_3dPoint& to);
//Guid AddLine2(Point3d from, Point3d to, DocObjects.ObjectAttributes attributes)
BND_UUID AddLine2(const ON_3dPoint& from, const ON_3dPoint& to, const class BND_3dmObjectAttributes* attributes);
//Guid AddLine3(Line line)
//Guid AddLine4(Line line, DocObjects.ObjectAttributes attributes)
BND_UUID AddPolyline1(const class BND_Point3dList& points, const class BND_3dmObjectAttributes* attributes);
Expand Down

0 comments on commit 3884f01

Please sign in to comment.