


{"id":403222,"date":"2025-01-02T11:03:10","date_gmt":"2025-01-02T11:03:10","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/"},"modified":"2025-01-02T11:03:10","modified_gmt":"2025-01-02T11:03:10","slug":"403222","status":"publish","type":"reply","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/","title":{"rendered":"Reply To: Zemax: creating an array of tilted source"},"content":{"rendered":"<p>&lt;p&gt;Hello,&lt;\/p&gt;&lt;p&gt;To the best of my knowledge, you won&rsquo;t find an object that readily does that.&lt;\/p&gt;&lt;p&gt;However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.&lt;\/p&gt;&lt;p&gt;Here&rsquo;s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same point, you use-case being simplier it is rather easy to edit the code to match your needs:&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;<\/p>\n<blockquote><p>&lt;p&gt;# &#8220;Focal&#8221; distance of the detectors&lt;br&gt;distance = 25&lt;br&gt;&lt;br&gt;# Distance between detectors as a factor of the index value&lt;br&gt;factor = 4&lt;br&gt;&lt;br&gt;FOR det_index, -5, 5, 1&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;# Insert new object in first line of editor&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;INSERTOBJECT 1, 1&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;# Change object type to Detector Rectangle&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;SETNSCPROPERTY 1, 1, 0, 0, &#8220;NSC_DETE&#8221;&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;# Calculate Detector Y Position&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;y_pos = factor * det_index&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;# Change Detector Y Position&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;SETNSCPOSITION 1, 1, 2, y_pos&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;# Calculated required Tilt About X in deg&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;IF (det_index == 0)&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tilt_x = 0&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;ELSE&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tilt_x = 90 &#8211; ATAN( distance \/ y_pos ) \/ 3.14159265359 * 180&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;ENDIF&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;# Adjust Detector Tilt About X&lt;br&gt;&nbsp;&nbsp;&nbsp;&nbsp;SETNSCPOSITION 1, 1, 4, tilt_x&lt;br&gt;NEXT&lt;\/p&gt;<\/p><\/blockquote>\n<p>&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;If you run this macro, this is what the 3D Layout will look like:&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;figure&gt;<img decoding=\"async\" src=\"https:\/\/uploads-us-west-2.insided.com\/zemax-en\/attachment\/04fb058f-30aa-4840-9ea3-71beb30c2e7e.png\" alt=\"\" \/>&lt;\/figure&gt;&lt;p&gt;&lt;br&gt;If you need the array to be parametric and\/or if your array is very large, it could then be more convenient to program the source the way you need with the Source DLL option.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-403222","reply","type-reply","status-publish","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hello,To the best of my knowledge, you won\u2019t find an object that readily does that.However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.Here\u2019s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Reply To: Zemax: creating an array of tilted source | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"Hello,To the best of my knowledge, you won\u2019t find an object that readily does that.However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.Here\u2019s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-01-02T11:03:10+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-01-02T11:03:10+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Reply To: Zemax: creating an array of tilted source | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hello,To the best of my knowledge, you won\u2019t find an object that readily does that.However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.Here\u2019s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/403222\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/403222\\\/#listItem\",\"name\":\"Reply To: Zemax: creating an array of tilted source\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/403222\\\/#listItem\",\"position\":2,\"name\":\"Reply To: Zemax: creating an array of tilted source\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/403222\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/403222\\\/\",\"name\":\"Reply To: Zemax: creating an array of tilted source | Ansys Learning Forum\",\"description\":\"Hello,To the best of my knowledge, you won\\u2019t find an object that readily does that.However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.Here\\u2019s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/403222\\\/#breadcrumblist\"},\"datePublished\":\"2025-01-02T11:03:10+00:00\",\"dateModified\":\"2025-01-02T11:03:10+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Reply To: Zemax: creating an array of tilted source | Ansys Learning Forum","description":"Hello,To the best of my knowledge, you won\u2019t find an object that readily does that.However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.Here\u2019s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/#listItem","name":"Reply To: Zemax: creating an array of tilted source"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/#listItem","position":2,"name":"Reply To: Zemax: creating an array of tilted source","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/","name":"Reply To: Zemax: creating an array of tilted source | Ansys Learning Forum","description":"Hello,To the best of my knowledge, you won\u2019t find an object that readily does that.However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.Here\u2019s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/#breadcrumblist"},"datePublished":"2025-01-02T11:03:10+00:00","dateModified":"2025-01-02T11:03:10+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"Reply To: Zemax: creating an array of tilted source | Ansys Learning Forum","og:description":"Hello,To the best of my knowledge, you won\u2019t find an object that readily does that.However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.Here\u2019s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/","article:published_time":"2025-01-02T11:03:10+00:00","article:modified_time":"2025-01-02T11:03:10+00:00","twitter:card":"summary_large_image","twitter:title":"Reply To: Zemax: creating an array of tilted source | Ansys Learning Forum","twitter:description":"Hello,To the best of my knowledge, you won\u2019t find an object that readily does that.However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.Here\u2019s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same"},"aioseo_meta_data":{"post_id":"403222","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2025-10-17 22:57:10","updated":"2025-10-17 22:57:10","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tReply To: Zemax: creating an array of tilted source\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Reply To: Zemax: creating an array of tilted source","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/403222\/"}],"acf":[],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/403222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/reply"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/403222\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=403222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}