Hi,
I was expecting this to work
from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
Part_1 = model.addPart(partSet)
partdoc = Part_1.document()
a_box = model.addBox(partdoc, 1, 2, 2)
moved_box=model.addTranslation(partdoc, [a_box], vector = [0,0, 4] , keepSubResults = True)
That fails with this error
TypeError: in method ‘addTranslation’, argument 2 of type ‘std::list< ModelHighAPI_Selection,std::allocator< ModelHighAPI_Selection > > const &’
what am I doing wrong?
The code works by replacing the last line with this
moved_box=model.addTranslation(partdoc, [model.selection("COMPOUND", "all-in-"+a_box.name())], vector = [0,0, 4] , keepSubResults = True)
But that makes the code hard to read and maintain, how do you know what name the module is using for the model.selection function?
Is there a better way of doing this?
thanks for your help