From 7fef64241df20bd39fe559f975fda478f48da161 Mon Sep 17 00:00:00 2001 From: mwganson Date: Fri, 23 Aug 2019 22:45:36 -0500 Subject: [PATCH] [Part workbench] add command create points object from mesh --- src/Mod/Part/Gui/CommandSimple.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Mod/Part/Gui/CommandSimple.cpp b/src/Mod/Part/Gui/CommandSimple.cpp index 2dce9fb58c..bc74ab2756 100644 --- a/src/Mod/Part/Gui/CommandSimple.cpp +++ b/src/Mod/Part/Gui/CommandSimple.cpp @@ -195,20 +195,18 @@ void CmdPartPointsFromMesh::activated(int iMsg) Gui::WaitCursor wc; std::vector::iterator it; openCommand("Points from mesh"); + for (it = meshes.begin(); it != meshes.end(); ++it) { App::Document* doc = (*it)->getDocument(); std::string mesh = (*it)->getNameInDocument(); - if (!(*it)->isDerivedFrom(Base::Type::fromName("Mesh::Feature"))) continue; doCommand(Doc,"import Part"); doCommand(Doc,"mesh_pts = FreeCAD.getDocument(\"%s\").getObject(\"%s\").Mesh.Points\n", - doc->getName(), - mesh.c_str()); + doc->getName(), mesh.c_str()); doCommand(Doc,"Part.show(Part.makeCompound([Part.Point(m.Vector).toShape() for m in mesh_pts]),\"%s\")\n", (mesh+"_pts").c_str()); doCommand(Doc,"del mesh_pts\n"); - } commitCommand();