Hi,
On my Interactor PythonPart, I can create well my object but the preview doesn't work
Here my code :
... def on_preview_draw(self): """ Handles the preview draw event """ self.create_geometry(True) ... def process_mouse_msg(self, mouse_msg, pnt, msg_info): """ Process the mouse message event Args: mouse_msg : the mouse message pnt : the input point in view coordinates msg_info : additional message info. Returns: True/False for success. """ input_pnt = self.coord_input.GetInputPoint(mouse_msg, pnt, msg_info).GetPoint() if self.coord_input.IsMouseMove(mouse_msg): return True self.selected_pnts.append(input_pnt) if len(self.selected_pnts) == 1: self.create_geometry(False) self.reset_pnts() return True def create_geometry(self, is_preview): """ Draw the preview Args: is_preview : True/False if preview mode. """ self.axis = Geometry.AxisPlacement3D(Geometry.Point3D(), Geometry.Vector3D(1, 0, 0), Geometry.Vector3D(0, 0, 1) ) self.placement_mat.SetTranslation(Geometry.Vector3D(self.selected_pnts[0])) self.geo = Geometry.BRep3D.CreateCuboid(self.axis, 1000, 1000, 1000) self.model_ele_list.append(BasisElements.ModelElement3D(self.com_prop, self.geo)) if is_preview: BaseElements.DrawElementPreview(self.coord_input.GetInputViewDocument(), self.placement_mat, self.model_ele_list, False, None ) else: self.create_pythonpart()
Where am I wrong ?
Best regards