{"id":26118,"date":"2020-06-23T09:31:50","date_gmt":"2020-06-23T09:31:50","guid":{"rendered":"https:\/\/stg.visualarq.com\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/"},"modified":"2020-06-23T09:31:50","modified_gmt":"2020-06-23T09:31:50","slug":"is-there-an-api-or-sdk-for-visualarq","status":"publish","type":"tip","link":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/","title":{"rendered":"Is there an API or SDK for VisualARQ?"},"content":{"rendered":"<p>Yes, from 2.4 version VisualARQ has an API accessible from RhinoCommon (C#, VB.NET, Python).<\/p>\r\n<p>Some of its methods allow to work with:<\/p>\r\n<ul>\r\n  <li>Common Style operations (rename, delete, etc)<\/li>\r\n  <li>Parameters<\/li>\r\n  <li>Wall and Wall Styles<\/li>\r\n  <li>Element and Element Styles<\/li>\r\n  <li>Furniture and Furniture Styles<\/li>\r\n  <li>Beam and Beam Styles<\/li>\r\n  <li>Column and Column Styles<\/li>\r\n  <li>Door and Door Styles<\/li>\r\n  <li>Window and Window Styles<\/li>\r\n<\/ul>\r\n<p class=\"Mb-3em\">This API has been created to work with document resident objects (create, edit, modify and delete) using their object ID.<\/p>\r\n<p>To use the API, reference the <strong><code>VisualARQ.Script.dll<\/code><\/strong> assembly that is installed with VisualARQ. You\u2019ll find it next to <code>Rhino.exe<\/code>, usually in <code>C:\\Program Files\\Rhino 6\\System<\/code>. Once referenced in your project you can call any of its methods.<\/p>\r\n<p class=\"Mb-3em\">If VisualARQ is not yet loaded, the assembly will take care of any initialization needed on the first call to one of its methods.<\/p>\r\n<hr class=\"separator\">\r\n<h2>From a Rhino C# plug-in<\/h2>\r\n<p><a href=\"https:\/\/developer.rhino3d.com\/guides\/rhinocommon\/\" rel=\"noopener noreferrer\" target=\"_blank\">Create a Rhino C# plug-in<\/a> and use the API as RhinoCommon or any other .NET assembly in the project.<\/p>\r\n<p>Here is a sample code of a command that creates a generic element style, inserts an element with that style, and finally creates a document parameter and sets a value to this parameter on the element.<\/p>\r\n<style>\r\n.code-comment {color:#998;font-style:italic;}\r\n.code-keyword {font-weight:bold;}\r\n.code-title {color:#d14;font-weight:bold;}\r\n.code-string {color:#d14;}\r\n.code-number {color:#099;}\r\n<\/style>\r\n<pre class=\"mb-4\" style=\"font-family: Consolas, Menlo, Monaco, 'Courier New', monospace; background-color: #f9f9f9;\">\r\n<code>\r\n<span class=\"code-keyword\">using<\/span> System;\r\n<span class=\"code-keyword\">using<\/span> System.Collections.Generic;\r\n<span class=\"code-keyword\">using<\/span> Rhino;\r\n<span class=\"code-keyword\">using<\/span> Rhino.Commands;\r\n<span class=\"code-keyword\">using<\/span> Rhino.Geometry;\r\n<span class=\"code-keyword\">using<\/span> Rhino.Input;\r\n<span class=\"code-keyword\">using<\/span> Rhino.Input.Custom;\r\n<span class=\"code-keyword\">using<\/span> va = VisualARQ.Script;\r\n\r\n<span class=\"code-keyword\">namespace<\/span> <span class=\"code-title\">VisualARQ<\/span>\r\n{\r\n   <span class=\"code-keyword\">public<\/span> <span class=\"code-keyword\">class<\/span> <span class=\"code-title\">VaScriptSampleCommand<\/span> : <span class=\"code-title\">Command<\/span>\r\n   {\r\n      <span><span class=\"code-keyword\">public<\/span> <span class=\"code-title\">VaScriptSampleCommand<\/span>()<\/span>\r\n      {\r\n         <span class=\"code-comment\">\/\/ Rhino only creates one instance of each command class defined in a<\/span>\r\n         <span class=\"code-comment\">\/\/ plug-in, so it is safe to store a refence in a static property.<\/span>\r\n         Instance = <span class=\"code-keyword\">this<\/span>;\r\n      }\r\n\r\n      <span class=\"code-comment\">\/\/\/&lt;summary&gt;The only instance of this command.&lt;\/summary&gt;<\/span>\r\n      <span class=\"code-keyword\">public<\/span> <span class=\"code-keyword\">static<\/span> VaScriptSampleCommand Instance\r\n      {\r\n         <span class=\"code-keyword\">get<\/span>; <span class=\"code-keyword\">private<\/span> <span class=\"code-keyword\">set<\/span>;\r\n      }\r\n\r\n      <span class=\"code-comment\">\/\/\/&lt;returns&gt;The command name as it appears on the Rhino command line.&lt;\/returns&gt;<\/span>\r\n      <span class=\"code-keyword\">public<\/span> <span class=\"code-keyword\">override<\/span> <span class=\"code-keyword\">string<\/span> EnglishName\r\n      {\r\n         <span class=\"code-keyword\">get<\/span> { <span class=\"code-keyword\">return<\/span> <span class=\"code-string\">\"ScriptSampleCommand\"<\/span>; }\r\n      }\r\n\r\n      <span><span class=\"code-keyword\">protected<\/span> <span class=\"code-keyword\">override<\/span> Result <span class=\"code-title\">RunCommand<\/span>(RhinoDoc doc, RunMode mode)<\/span>\r\n      {\r\n         <span class=\"code-comment\">\/\/ Get units scale factor from meters to document units<\/span>\r\n         <span class=\"code-keyword\">double<\/span> unitScale = RhinoMath.UnitScale(UnitSystem.Meters, doc.ModelUnitSystem);\r\n\r\n         <span class=\"code-comment\">\/\/ Create a block with a sphere as model representation<\/span>\r\n         <span class=\"code-keyword\">var<\/span> sphere = Brep.CreateFromSphere(<span class=\"code-keyword\">new<\/span> Sphere(Point3d.Origin, <span class=\"code-number\">1.0<\/span> * unitScale));\r\n         doc.InstanceDefinitions.Add(<span class=\"code-string\">\"Sphere\"<\/span>, <span class=\"code-keyword\">string<\/span>.Empty, Point3d.Origin, <span class=\"code-keyword\">new<\/span>[] { sphere });\r\n\r\n         <span class=\"code-comment\">\/\/ Create a block with a circle as plan representation<\/span>\r\n         <span class=\"code-keyword\">var<\/span> circle = <span class=\"code-keyword\">new<\/span> ArcCurve(<span class=\"code-keyword\">new<\/span> Circle(Point3d.Origin, <span class=\"code-number\">1.0<\/span> * unitScale));\r\n         <span class=\"code-keyword\">var<\/span> idefIndex = doc.InstanceDefinitions.Add(<span class=\"code-string\">\"Circle\"<\/span>, <span class=\"code-keyword\">string<\/span>.Empty, Point3d.Origin, <span class=\"code-keyword\">new<\/span>[] { circle });\r\n\r\n         <span class=\"code-comment\">\/\/ Create a VisualARQ Generic Element Style<\/span>\r\n         <span class=\"code-keyword\">var<\/span> styleId = va.AddGenericElementStyle(<span class=\"code-string\">\"Sphere\"<\/span>, <span class=\"code-keyword\">new<\/span> List&lt;<span class=\"code-keyword\">string<\/span>&gt;() { <span class=\"code-string\">\"Sphere\"<\/span> }, <span class=\"code-keyword\">new<\/span> List&lt;<span class=\"code-keyword\">string<\/span>&gt;() { <span class=\"code-string\">\"Circle\"<\/span> });\r\n\r\n         <span class=\"code-comment\">\/\/ Insert VisualARQ Generic Element<\/span>\r\n         <span class=\"code-keyword\">var<\/span> elementId = va.AddGenericElement(styleId, <span class=\"code-keyword\">new<\/span> Point3d(<span class=\"code-number\">1.0<\/span>, <span class=\"code-number\">1.0<\/span>, <span class=\"code-number\">1.0<\/span>), <span class=\"code-number\">2.0<\/span>);\r\n\r\n         <span class=\"code-comment\">\/\/ Change Element position<\/span>\r\n         Point3d pos = va.GetGenericElementPosition(elementId);\r\n         va.SetGenericElementPosition(elementId, pos + <span class=\"code-keyword\">new<\/span> Vector3d(<span class=\"code-number\">2.0<\/span>, <span class=\"code-number\">2.0<\/span>, <span class=\"code-number\">-2.0<\/span>));\r\n\r\n         <span class=\"code-comment\">\/\/ Create a document parameter \"price\"<\/span>\r\n         <span class=\"code-keyword\">var<\/span> priceId = va.AddDocumentParameter(<span class=\"code-string\">\"Price\"<\/span>, va.ParameterType.Currency, <span class=\"code-string\">\"Costs\"<\/span>);\r\n\r\n         <span class=\"code-comment\">\/\/ Set \"Price\" value to element<\/span>\r\n         va.SetParameterValue(priceId, elementId, <span class=\"code-number\">100.0<\/span>);\r\n\r\n         <span class=\"code-keyword\">return<\/span> Result.Success;\r\n      }\r\n   }\r\n}\r\n\r\n<\/code><\/pre>\r\n<hr class=\"separator\">\r\n<h2>From the RhinoPythonScript Editor<\/h2>\r\n<p>This is an example of how to use it from the <a href=\"https:\/\/developer.rhino3d.com\/guides\/rhinopython\/python-editing-scripts\/\" rel=\"noopener noreferrer\" target=\"_blank\">integrated Rhino Python Script Editor<\/a> to create a script that adds a parameter to all the beam styles:<\/p>\r\n<div style=\"width: 1080px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-26118-1\" width=\"1080\" height=\"608\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/stg.visualarq.com\/wp-content\/uploads\/2020\/06\/VisualARQ-API-Python-Long-Q35_nointro.mp4?_=1\" \/><a href=\"https:\/\/stg.visualarq.com\/wp-content\/uploads\/2020\/06\/VisualARQ-API-Python-Long-Q35_nointro.mp4\">https:\/\/stg.visualarq.com\/wp-content\/uploads\/2020\/06\/VisualARQ-API-Python-Long-Q35_nointro.mp4<\/a><\/video><\/div>\r\n<hr class=\"separator\">\r\n<h2>From Grasshopper<\/h2>\r\n<p>If you plan to use the API from any of the Grasshopper scripting components take into account that <strong>it is not recommended to use this API in Grasshopper<\/strong>.<\/p>\r\n<p>The reason is that the VisualARQ Script API is intended to be used with document resident objects, while Grasshopper works with in-memory (temporary) geometry-only objects. This means that if for example you manipulate the geometry of a VisualARQ object, it will create a new object each time you change a value.<\/p>\r\n<p>Support for Grasshopper scripting may be added in the future.<\/p>\r\n<blockquote>\r\n<p><strong>Note<\/strong><\/p>\r\n<p>VisualARQ Script API is still in WIP. Not all features are exposed yet, neither there is documentation.<\/p>\r\n<p>If you need a method that is missing contact us: <em>visualarq@asuni.com<\/em>.<\/p>\r\n<\/blockquote>","protected":false},"featured_media":19207,"parent":0,"menu_order":0,"template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"tipgroup":[169],"class_list":["post-26118","tip","type-tip","status-publish","has-post-thumbnail","hentry","tipgroup-workflow-ko"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Is there an API or SDK for VisualARQ? - VisualARQ<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Is there an API or SDK for VisualARQ? - VisualARQ\" \/>\n<meta property=\"og:description\" content=\"Yes, from 2.4 version VisualARQ has an API accessible from RhinoCommon (C#, VB.NET, Python). Some of its methods allow to work with: Common Style operations (rename, delete, etc) Parameters Wall and Wall Styles Element and Element Styles Furniture and Furniture Styles Beam and Beam Styles Column and Column Styles Door and Door Styles Window and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/\" \/>\n<meta property=\"og:site_name\" content=\"VisualARQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/visualarq\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@VisualARQ\" \/>\n<meta name=\"twitter:label1\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data1\" content=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/is-there-an-api-or-sdk-for-visualarq\\\/\",\"url\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/is-there-an-api-or-sdk-for-visualarq\\\/\",\"name\":\"Is there an API or SDK for VisualARQ? - VisualARQ\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/is-there-an-api-or-sdk-for-visualarq\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/is-there-an-api-or-sdk-for-visualarq\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/stg.visualarq.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/VisualARQ_API.png\",\"datePublished\":\"2020-06-23T09:31:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/is-there-an-api-or-sdk-for-visualarq\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/is-there-an-api-or-sdk-for-visualarq\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/is-there-an-api-or-sdk-for-visualarq\\\/#primaryimage\",\"url\":\"https:\\\/\\\/stg.visualarq.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/VisualARQ_API.png\",\"contentUrl\":\"https:\\\/\\\/stg.visualarq.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/VisualARQ_API.png\",\"width\":600,\"height\":314,\"caption\":\"VisualARQ API for .NET including Iron Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/is-there-an-api-or-sdk-for-visualarq\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tips\",\"item\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/support\\\/tip\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Is there an API or SDK for VisualARQ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/#website\",\"url\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/\",\"name\":\"VisualARQ\",\"description\":\"Flexible BIM for Rhino\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/stg.visualarq.com\\\/ko\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Is there an API or SDK for VisualARQ? - VisualARQ","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"ko_KR","og_type":"article","og_title":"Is there an API or SDK for VisualARQ? - VisualARQ","og_description":"Yes, from 2.4 version VisualARQ has an API accessible from RhinoCommon (C#, VB.NET, Python). Some of its methods allow to work with: Common Style operations (rename, delete, etc) Parameters Wall and Wall Styles Element and Element Styles Furniture and Furniture Styles Beam and Beam Styles Column and Column Styles Door and Door Styles Window and [&hellip;]","og_url":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/","og_site_name":"VisualARQ","article_publisher":"https:\/\/www.facebook.com\/visualarq","twitter_card":"summary_large_image","twitter_site":"@VisualARQ","twitter_misc":{"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/","url":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/","name":"Is there an API or SDK for VisualARQ? - VisualARQ","isPartOf":{"@id":"https:\/\/stg.visualarq.com\/ko\/#website"},"primaryImageOfPage":{"@id":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/#primaryimage"},"image":{"@id":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/#primaryimage"},"thumbnailUrl":"https:\/\/stg.visualarq.com\/wp-content\/uploads\/2020\/06\/VisualARQ_API.png","datePublished":"2020-06-23T09:31:50+00:00","breadcrumb":{"@id":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/#primaryimage","url":"https:\/\/stg.visualarq.com\/wp-content\/uploads\/2020\/06\/VisualARQ_API.png","contentUrl":"https:\/\/stg.visualarq.com\/wp-content\/uploads\/2020\/06\/VisualARQ_API.png","width":600,"height":314,"caption":"VisualARQ API for .NET including Iron Python"},{"@type":"BreadcrumbList","@id":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/is-there-an-api-or-sdk-for-visualarq\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/stg.visualarq.com\/ko\/home\/"},{"@type":"ListItem","position":2,"name":"Tips","item":"https:\/\/stg.visualarq.com\/ko\/support\/tip\/"},{"@type":"ListItem","position":3,"name":"Is there an API or SDK for VisualARQ?"}]},{"@type":"WebSite","@id":"https:\/\/stg.visualarq.com\/ko\/#website","url":"https:\/\/stg.visualarq.com\/ko\/","name":"VisualARQ","description":"Flexible BIM for Rhino","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/stg.visualarq.com\/ko\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"}]}},"_links":{"self":[{"href":"https:\/\/stg.visualarq.com\/ko\/wp-json\/wp\/v2\/tip\/26118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stg.visualarq.com\/ko\/wp-json\/wp\/v2\/tip"}],"about":[{"href":"https:\/\/stg.visualarq.com\/ko\/wp-json\/wp\/v2\/types\/tip"}],"version-history":[{"count":0,"href":"https:\/\/stg.visualarq.com\/ko\/wp-json\/wp\/v2\/tip\/26118\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stg.visualarq.com\/ko\/wp-json\/wp\/v2\/media\/19207"}],"wp:attachment":[{"href":"https:\/\/stg.visualarq.com\/ko\/wp-json\/wp\/v2\/media?parent=26118"}],"wp:term":[{"taxonomy":"tipgroup","embeddable":true,"href":"https:\/\/stg.visualarq.com\/ko\/wp-json\/wp\/v2\/tipgroup?post=26118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}