Forum

Black views – API ROBOT

Home Forums Temas ou Discussões Black views – API ROBOT

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • louispips50
    Guest
    Post count: 172

    Hi everyone,

    I have one question about screen capture.

    If I create .rtf file with captures all is good but if I save screen capture from clipboard the view is black :

    modele_view=structure.Selections.Get(IRobotObjectType.I_OT_OBJECT)
    modele_view.FromText(“Panel”)
    viewRobot=IRobotView3(app.Project.ViewMngr.CreateView(IRobotViewType.I_VT_STANDARD))
    viewRobot.Selection.Set(IRobotObjectType.I_OT_OBJECT, modele_view)
    viewRobot.Visible = True
    viewRobot.Redraw(0)
    viewRobot.Projection=IRobotViewProjection.I_VP_3DXYZ
    viewRobot.Title = “Vue du modèle”
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_STRUCTURE_STRUCTURE, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_STRUCTURE_BAR_NUMBERS, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_STRUCTURE_SUPPORT_SYMBOLS, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_STRUCTURE_ATTRIBUTE_LABELS, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_SECTIONS_NAME, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_SECTIONS_SURFACE, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_SECTIONS_MATERIAL, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_FE_PANEL_CONTOURS, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_FE_PANEL_NAMES , True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_FE_PANEL_THICKNESSES , True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_FE_CONTOUR_COMPONENTS, True)
    viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_ADVANCED_ELASTIC_FOUNDATION, True)
    scPar=IRobotViewScreenCaptureParams(app.CmpntFactory.Create(IRobotComponentType.I_CT_VIEW_SCREEN_CAPTURE_PARAMS))
    scPar.Name=”Vue du modèle”
    scPar.UpdateType = IRobotViewScreenCaptureUpdateType.I_SCUT_CURRENT_VIEW
    scPar.Resolution = IRobotViewScreenCaptureResolution.I_VSCR_4096
    scPar.UpdateType = IRobotViewScreenCaptureUpdateType.I_SCUT_COPY_TO_CLIPBOARD
    viewRobot.MakeScreenCapture(scPar)

    from PIL import ImageGrab, Image
    im= ImageGrab.grabclipboard()
    if isinstance(im, Image.Image):
    im.save(‘Vue du modèle.png’)

    Do you have any ideas to fix it ?

    Thank you in advance,
    Regards

    russellia
    Guest
    Post count: 172

    Have you tried :
    put a delay between copying and saving,
    save in another format (bmp),
    refresh the view before capture (viewmngr.refresh),
    to decrease the resolution (2048, 3096),
    to review whether the structure is actually visible before capture

    To set on and off parameters

    Best regards

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Home Forums Temas ou Discussões Black views – API ROBOT