<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I set the photo eye type in code? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487360#M5633</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 16.0.1 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a photo eye that I put on a conveyor using code (just create the photo eye into the conveyor to create the link automatically) and I would want the photo to be a certain pre-defined type that I have created earlier. How can I set the type in code? Should I first create a basic photo eye with createinstance and then set the type or can I create a copy of the instance in the conveyor system?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2016 16:27:48 GMT</pubDate>
    <dc:creator>axel_kohonen</dc:creator>
    <dc:date>2016-06-03T16:27:48Z</dc:date>
    <item>
      <title>How do I set the photo eye type in code?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487360#M5633</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 16.0.1 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a photo eye that I put on a conveyor using code (just create the photo eye into the conveyor to create the link automatically) and I would want the photo to be a certain pre-defined type that I have created earlier. How can I set the type in code? Should I first create a basic photo eye with createinstance and then set the type or can I create a copy of the instance in the conveyor system?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 16:27:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487360#M5633</guid>
      <dc:creator>axel_kohonen</dc:creator>
      <dc:date>2016-06-03T16:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the photo eye type in code?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487361#M5634</link>
      <description>&lt;P&gt;Photo Eyes (and all conveyor objects) have a type variable that points at their type object. This can either be a global type stored on the Conveyor System object or a custom type stored in the objects variables. &lt;/P&gt;&lt;P&gt;To set the type just point the type variable at the desired type:&lt;/P&gt;&lt;PRE&gt;treenode photoEye = node("PE1", model());
treenode typeVar = getvarnode(photoEye, "type");
treenode desiredType = node("ConveyorSystem&amp;gt;variables/photoEyeTypes/PEType1", model());

nodepoint(typeVar, desiredType);&lt;/PRE&gt;&lt;P&gt;You can sample the types in the toolbox from the sampler in the script console to get the paths to each type.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="409-typesampler.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1493452i92789606BBAA88E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="409-typesampler.png" alt="409-typesampler.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To set the type to custom point the "type" variable at the object's "localType" variable.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 17:21:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487361#M5634</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2016-06-03T17:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the photo eye type in code?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487362#M5635</link>
      <description>&lt;P&gt;Hi Mathew,&lt;/P&gt;&lt;P&gt;Can you explain why you used nodepoint() command? &lt;/P&gt;&lt;P&gt;Is the photo eye type a coupling data in the photo-eye object.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun KR&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 10:04:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487362#M5635</guid>
      <dc:creator>arunTTT2P</dc:creator>
      <dc:date>2016-06-04T10:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the photo eye type in code?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487363#M5636</link>
      <description>&lt;P&gt;Thank you Matthew! Works well. I would like to know the answer to Arun's comment as well.&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 05:34:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487363#M5636</guid>
      <dc:creator>axel_kohonen</dc:creator>
      <dc:date>2016-06-06T05:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the photo eye type in code?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487364#M5637</link>
      <description>&lt;P&gt;Yes, I used the nodepoint command because the type variable has coupling data. This means it stores a reference to another node, or that it "points" at another node. The way that you set what a coupling node is pointing at is to use the nodepoint command.&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.flexsim.com/questions/22339/how-do-i-set-the-photo-eye-type-in-code.html#"&gt;@Axel Kohonen&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 17:19:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487364#M5637</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2016-06-06T17:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the photo eye type in code?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487365#M5638</link>
      <description>&lt;P&gt;Anyone finding this thread looking for more information on couplings, in addition to the nodepoint() command, which is a one-way pointer, be sure to check out createcoupling(), which creates a two-way pointer/reference.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 17:55:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-set-the-photo-eye-type-in-code/m-p/13487365#M5638</guid>
      <dc:creator>Ben_WilsonADSK</dc:creator>
      <dc:date>2016-06-06T17:55:29Z</dc:date>
    </item>
  </channel>
</rss>

