renderViews_r2009

Embed Size (px)

Citation preview

  • 7/31/2019 renderViews_r2009

    1/2

    'Script to render and export TIFFs for every specified view, courtesy of buildz.blogspot.com'''put this file in the same folder as the .rvt file to be rendered.'set your RENDER SETTINGS below'save changes and drag this file from Windows Explorer onto your Revit shortcuticon to run.'The last saved state of your file MUST be:'all views to be rendered in the file MUST have render settings set to "print" NOT "screen"'render quality of each view must be set to something other than target output (i.e. you can't save the view with quality set to "High" if script is going to set it to "High" too)'You can ignore these next two linesDim Jrn, FileNameSet Jrn = CrsJournalScript

    '''''''''''''RENDER SETTINGS''''''''''''''RENDER SETTINGS''''''''''''''''RENDERSETTINGS'''''''''''''

    ''''''''enter your file nameYourFileName = "Project1_noWorksets.rvt"

    ''''''''put all your views here, syntax is view names in double quotes seperatedby commas, add more as neededViewArray = Array("3D View 1","3D View 2")

    ''''''''enter your desired output dpi, you can't put in a preset dpi (i.e., 75,150, 300, or 600)or the dpi to which the view is currently setResolutionDPI = "50"

    ''''''''enter your desired quality, choices are Draft, Low, Medium, High, or BestRenderQuality = "Low"

    ''''''''if your file is workseted, set value to 1, if not workseted, set to 0

    RenderWorksets = 1

    '''''''''''''END OF RENDER SETTINGS''''''''''''''END OF RENDER SETTINGS''''''''''''''''END OF RENDER SETTINGS'''''''''''''

    Jrn.Command "Internal" , "Open an existing project , 57601 , ID_REVIT_FILE_OPEN"Jrn.Data "File Name" , "IDOK", YourFileNameJrn.Browser "Activate" , " "Jrn.Browser "ToggleExpandedState" _

    , ">>Views (all)>>3D Views>>"

    For Each View in ViewArray

    Jrn.Browser "Activate" , " "Jrn.Browser "SelChange" , ">>Views (all)>>3D Views>>" & View & ">>"Jrn.Browser "LButtonDblClk" , ">>Views (all)>>3D Views>>" & View & ">>"

    'zoom to fitJrn.Command "ContextMenu" , "Performs a ""Zoom To Fit"" in all open windows. , 33151 , ID_ZOOM_ALL_ALL"

    'call Render DialogueJrn.Command "KeyboardShortcut" , "Display the raytraced view. , ID_PHOTO_RENDERI

  • 7/31/2019 renderViews_r2009

    2/2

    NG_VIEW"

    'set resolutionJrn.ComboBox "Modeless , Rendering , Dialog_Revit_ProteinRenderingDlg" , "Control_Revit_RenderDpi" , "ReplaceContents" , ResolutionDPIJrn.ComboBox "Modeless , Rendering , Dialog_Revit_ProteinRenderingDlg" , "Control_Revit_RenderDpi" , "Select" , "Custom (" & ResolutionDPI & " dpi)"Jrn.Data "Transaction Successful" , "Rendering Settings"

    'set renderqualityJrn.ComboBox "Modeless , Rendering , Dialog_Revit_ProteinRenderingDlg" , "Control_Revit_RenderQuality" , "SelEndOk" , RenderQualityJrn.Data "Transaction Successful" , "Choose a rendering quality setting"

    'renderJrn.PushButton "Modeless , Rendering , Dialog_Revit_ProteinRenderingDlg" , "Render, Control_Revit_Render"Jrn.Data "Transaction Successful" , "Rendering Settings"

    'export imageJrn.PushButton "Modeless , Rendering , Dialog_Revit_ProteinRenderingDlg" , "Export..., Control_Revit_ImageExport"Jrn.Data "FileDialog" , "IDOK", View & ".tif", "tif" , View & ".tif", ViewJrn.Data "FileType" , "TIFF Files (*.tif)"

    'reset to original stateJrn.Command "AccelKey" , "Undo the last action , ID_EDIT_UNDO"Jrn.Command "AccelKey" , "Undo the last action , ID_EDIT_UNDO"Jrn.Command "AccelKey" , "Undo the last action , ID_EDIT_UNDO"

    'end of loopNext

    'quit RevitJrn.Command "SystemMenu" , "Quit the application; prompts to save projects , 57665 , ID_APP_EXIT"

    If RenderWorksets ThenJrn.PushButton "Modal , Suggest Relinquish , Dialog_Revit_SuggestRelinquish" , "Don't Relinquish, Control_Revit_DontRelinquish"End If