From 3884f012583625f739c78f258304c82a967c0ce6 Mon Sep 17 00:00:00 2001 From: StudioWEngineers Date: Fri, 20 Dec 2024 16:12:14 +0100 Subject: [PATCH] AddLine with attributes --- src/bindings/bnd_extensions.cpp | 8 ++++++++ src/bindings/bnd_extensions.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bindings/bnd_extensions.cpp b/src/bindings/bnd_extensions.cpp index 46604f82..d93ead30 100644 --- a/src/bindings/bnd_extensions.cpp +++ b/src/bindings/bnd_extensions.cpp @@ -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); @@ -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) diff --git a/src/bindings/bnd_extensions.h b/src/bindings/bnd_extensions.h index 73d797d6..92cf0466 100644 --- a/src/bindings/bnd_extensions.h +++ b/src/bindings/bnd_extensions.h @@ -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);