I don't think nobody is paying attention, instead I suspect that people aren't quite sure of your problem.poserge wrote:I'm sorry no one pays attention to this bug which means people cope with it somehow, or I'm doing something wrong.
First, when you select only one face of the original Cube, you're actually selecting the entire Cube. If you look in the hierarchy tree after selecting a face you'll see that Cube is selected. So selecting one face of Cube, then doing Copy (or Ctrl + C) and Paste (or Ctrl + V) creates a new Cube001 just as expected. Cube001 is also located in exactly the same 3D space and is exactly the same size as Cube, which is also as expected.poserge wrote:Basically when faces of the objects are selected and object is copied and pasted you get copy of the object and empty grey objects in objects tree.
These are steps to reproduce the problem:
0.Create new document
1.Change workbench to Part
3.Select two or more faces of the cube with mouse via Ctrl+LeftClick
4.Copy and Paste
5.Observe copy of the Cube and gray objects in the objects tree.
Looking at the Model tab in the Combo View (by default on the left side of the FreeCAD window) as you select each Face could help you see if a new object gets selected or not as you select another face, but with tens of objects in your model this would be tedious and with hundreds of objects it would be a nightmare and also unpractical.poserge wrote:I'm working with complex stp files with many (tens to hundreds) overlapping objects. I need to select only some of them, so I pick faces in viewport and it's not always clear if I picked faces of different objects or several faces of one object.
Code: Select all
#!/usr/bin/env python # -*- coding: utf-8 -*- # snippet for creating Face features from multiple selection import FreeCAD import Part import Draft #select your faces, then run this macro s = FreeCADGui.Selection.getSelectionEx() s.Object.ViewObject.hide() for o in s: for obj in o.SubObjects: newobj = FreeCAD.ActiveDocument.addObject("Part::Feature","Face") newobj.Shape = obj.copy()
Code: Select all
def setPreselection(self, doc, object, sub): print "TYTY"
Code: Select all
# -*- coding: utf-8 -*- import FreeCADGui import PySide from PySide import QtGui ,QtCore from PySide.QtGui import * from PySide.QtCore import * __title__ = "Macro_Duplicate_Selection" __author__ = "Mario52" __url__ = "http://www.freecadweb.org/index-fr.html" __version__ = "00.00" __date__ = "06/06/2016" __Help__ = "Start the macro select the object IN THE 3D VIEW the ForbiddenCursor stay if the selection is duplicate" def selectionObject(): sel = FreeCADGui.Selection.getSelection() x =  del x[:] for a in range(len(sel)): x.append(sel[a].Name) doublet = 0 for i in range(len(sel)): for ii in range((i+1),len(sel)): if x[i] == x[ii]: doublet = 1 break if doublet == 1: QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.ForbiddenCursor)) # FreeCAD.Console.PrintError("HELP "+sel[-1].Name+" duplicate selection"+"\n") else: QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) class SelObserver: def addSelection(self,doc,obj,sub,pnt): # Selection selectionObject() def removeSelection(self,doc,obj,sub): # Effacer l'objet salectionne selectionObject() def setPreselection(self, doc, obj, sub): selectionObject() def clearSelection(self,doc): # Si clic sur l'ecran, effacer la selection selectionObject() # def setSelection(self,doc): # Selection dans Combo View pour quitter la fonction # App.Console.PrintMessage("Fin Macro_Duplicate"+"\n") # QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) # FreeCADGui.Selection.removeObserver(s)# desinstalle la fonction residente s=SelObserver() FreeCADGui.Selection.addObserver(s) # installe la fonction en mode resident