{"id":183825,"date":"2024-09-25T18:16:30","date_gmt":"2024-09-25T18:16:30","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/knowledge\/?post_type=topic&#038;p=183825"},"modified":"2024-09-26T13:55:37","modified_gmt":"2024-09-26T13:55:37","slug":"5-faqs-about-automating-with-ansys-rocky-prepost-scripting-tool","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/5-faqs-about-automating-with-ansys-rocky-prepost-scripting-tool\/","title":{"rendered":"5 FAQs about automating with Ansys Rocky\u2122 PrePost scripting tool"},"content":{"rendered":"<p>&nbsp;<\/p>\n<h2  id=\"1-WHAT-IS-AN-ANSYS-ROCKY-SCRIPT-AND-HOW-DOES-IT-WORK\"><strong>1. What is an Ansys Rocky\u2122 script, and how does it work?<\/strong><\/h2>\n<p>Ansys Rocky\u2122 PrePost script is a file written in Python that allows users to automate tasks within Ansys Rocky\u2122 application. It enables the automation of repetitive commands and procedures, making the simulation process more efficient and less prone to errors.<\/p>\n<p>&nbsp;<\/p>\n<h2  id=\"2-WHAT-ARE-THE-ADVANTAGES-OF-USING-ANSYS-ROCKY-SCRIPTS\"><strong>2. What are the advantages of using Ansys Rocky\u2122 scripts?<\/strong><\/h2>\n<p>The advantages of using Ansys Rocky\u2122 scripts include:<\/p>\n<ul>\n<li><strong>Automation:<\/strong> Reduces manual effort and minimizes human error in executing repetitive tasks.<\/li>\n<li><strong>Customization:<\/strong> Allows users to tailor simulations and analyses to specific needs or standards.<\/li>\n<li><strong>Efficiency:<\/strong> Speeds up simulation workflows by automating sequential tasks.<\/li>\n<li><strong>Reproducibility:<\/strong> Ensures consistency and traceability in simulation results.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2  id=\"3-WHERE-CAN-I-FIND-READY-TO-USE-SCRIPTS\">\u00a03. <strong>Where can I find Ready-to-use scripts?<\/strong><\/h2>\n<p>Find examples of Ready-to-use scripts downloading the <strong>Additional Package<\/strong> on <a href=\"https:\/\/download.ansys.com\/Current%20Release\">Ansys Customer Portal<\/a> . In the Downloads page select the <strong>Release Version<\/strong>, <strong>Operational System<\/strong> and download the <strong>Additional Package<\/strong> <strong>in Add-On Packages<\/strong> section.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-183831 aligncenter\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps1-300x114.png\" alt=\"\" width=\"851\" height=\"323\" srcset=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps1-300x114.png 300w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps1-1024x389.png 1024w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps1-768x291.png 768w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps1-24x9.png 24w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps1-36x14.png 36w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps1-48x18.png 48w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps1.png 1183w\" sizes=\"auto, (max-width: 851px) 100vw, 851px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2  id=\"4-HOW-TO-SAVE-AND-RUN-A-SCRIPT\"><strong>4. How to save and run a Script?<\/strong><\/h2>\n<ul>\n<li>Find the <strong>Scripts<\/strong> folder into the downloaded package.<\/li>\n<li>Extract which script for <strong>Documents <\/strong>folder.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-183832 aligncenter\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps2-300x115.png\" alt=\"\" width=\"817\" height=\"313\" srcset=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps2-300x115.png 300w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps2-1024x393.png 1024w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps2-768x295.png 768w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps2-24x9.png 24w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps2-36x14.png 36w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps2-48x18.png 48w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps2.png 1153w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><\/p>\n<ul>\n<li>Open Ansys Rocky\u2122 software, go to superior toolbar and select <strong>Tools <\/strong>then <strong>PrePost Scripts.<\/strong><\/li>\n<li>Select the desired script then click on the green play button in the <strong>PrePost Scripts.<\/strong><\/li>\n<\/ul>\n<p><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <img loading=\"lazy\" decoding=\"async\" class=\" wp-image-183833 aligncenter\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps3-300x172.png\" alt=\"\" width=\"778\" height=\"446\" srcset=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps3-300x172.png 300w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps3-1024x587.png 1024w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps3-768x440.png 768w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps3-24x14.png 24w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps3-36x21.png 36w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps3-48x27.png 48w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps3.png 1112w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/> <\/strong><\/p>\n<h2  id=\"5-HOW-TO-CREATE-A-SCRIPT\"><strong>5. How to create a Script?<\/strong><\/h2>\n<p>You can use the Integrated Development Environment (IDE) of your choice, such as Visual Studio Code (VSCode), PyCharm, or any other preferred Python IDE.<\/p>\n<p>For more information about the syntax and usage of <strong>PrePost Scripting<\/strong>, click in the link below to access directly the <strong>PrePost Scripting manual<\/strong> on <a href=\"https:\/\/developer.ansys.com\/docs\/rocky\">Ansys Developer Portal<\/a>. There you will find detailed information about the available classes, methods, and properties, as well as comprehensive guidance to create your first script.<\/p>\n<p style=\"text-align: left\"><strong><a href=\"https:\/\/developer.ansys.com\/docs\/rocky\">PrePost scripting manual on Rocky for Developers page<\/a><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-183834 aligncenter\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4-300x144.png\" alt=\"\" width=\"667\" height=\"320\" srcset=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4-300x144.png 300w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4-1024x491.png 1024w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4-768x368.png 768w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4-1536x736.png 1536w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4-24x12.png 24w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4-36x17.png 36w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4-48x23.png 48w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/ps4.png 1606w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p class=\"paragraph\" style=\"text-align: right\" align=\"right\"><span class=\"eop\"><span style=\"font-size: 16.0pt\">Ansys Rocky\u2122 particle dynamics simulation software <\/span><\/span><\/p>\n<p class=\"paragraph\" style=\"text-align: right\" xml:lang=\"EN-US\" align=\"right\"><span data-ccp-props=\"{\"><span class=\"eop\"><span style=\"font-size: 16.0pt\">Learn more about Ansys Rocky\u2122 software in <strong><a href=\"https:\/\/innovationspace.ansys.com\/ais-rocky\/\" data-wpel-link=\"external\">Ansys Rocky\u00a0 Innovation Space<\/a>.<\/strong><\/span><\/span><\/span><\/p>\n<p xml:lang=\"EN-US\" align=\"right\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-183835\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/author-jackson-300x143.png\" alt=\"\" width=\"417\" height=\"199\" srcset=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/author-jackson-300x143.png 300w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/author-jackson-24x11.png 24w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/author-jackson-36x17.png 36w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/author-jackson-48x23.png 48w, https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/author-jackson.png 695w\" sizes=\"auto, (max-width: 417px) 100vw, 417px\" \/><\/p>\n","protected":false},"template":"","class_list":["post-183825","topic","type-topic","status-publish","hentry","topic-tag-additional-features","topic-tag-ansys-rocky","topic-tag-ansys-rocky-api","topic-tag-prepost-scripting"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_edit_lock":["1734393509:17114"],"_edit_last":["17114"],"application_name":[""],"_application_name":["field_64a80903c8e15"],"filter_by_optics_product":["Lumerical"],"_filter_by_optics_product":["field_64fb192ba3121"],"family":["Fluids"],"_family":["field_64a809229a857"],"siebel_km_number":[""],"_siebel_km_number":["field_63ecbffce60db"],"salesforce_km_number":[""],"_salesforce_km_number":["field_63ecc018e60dc"],"km_published_date":[""],"_km_published_date":["field_64c77704499dd"],"product_version":[""],"_product_version":["field_64c776cb4fd2e"],"_bbp_forum_id":["180025"],"_bbp_topic_id":["183890"],"_bbp_author_ip":["192.104.24.225"],"_bbp_last_reply_id":["0"],"_bbp_last_active_id":["183826"],"_bbp_last_active_time":["2024-09-25 18:16:30"],"_bbp_reply_count":["0"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["0"],"_yoast_wpseo_content_score":["90"],"_yoast_wpseo_estimated-reading-time-minutes":["3"],"_btv_view_count":["4167"],"_bbp_likes_count":["3"],"_oembed_c9741472a814545dd28c0c2b9b213088":["<iframe title=\"Ansys Rocky: How To Create Custom Modules\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/UMM-63fl3Lk?list=PL0lZXwHtV6Omiv62KRuPbnZ4oBK8BmDit\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>"],"_oembed_time_c9741472a814545dd28c0c2b9b213088":["1734392444"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/183825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":10,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/183825\/revisions"}],"predecessor-version":[{"id":183827,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/183825\/revisions\/183827"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=183825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}