<?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 Re: How to use the code to set the position of the light source in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-the-code-to-set-the-position-of-the-light-source/m-p/13513288#M25849</link>
    <description>&lt;P&gt;You can set the location and rotation the same way as any other object in the model.&lt;/P&gt;&lt;P&gt;Here is one solution for you:&lt;/P&gt;&lt;PRE&gt;Object tempLight = Model.find("DirectionalLight1");
Vec3 tempVec;
tempVec.x = tempLight.location.x+1;
tempVec.y = tempLight.location.y+1;
tempVec.z = tempLight.location.z;
tempLight.location = tvec;&lt;/PRE&gt;&lt;P&gt;Here is another that does not use the Vec3 variable type:&lt;/P&gt;&lt;PRE&gt;Object tempLight = Model.find("DirectionalLight1");
tempLight.location.x += 1;
tempLight.location.y += 1;&lt;/PRE&gt;&lt;P&gt;I hope one of these works for you, Brandon&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2019 14:22:21 GMT</pubDate>
    <dc:creator>Brandon_Peterson</dc:creator>
    <dc:date>2019-12-17T14:22:21Z</dc:date>
    <item>
      <title>How to use the code to set the position of the light source</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-the-code-to-set-the-position-of-the-light-source/m-p/13513287#M25848</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;How to use the code to set the position of the light source, I want to change the position of the light source over time.&lt;/P&gt;
&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 12:13:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-the-code-to-set-the-position-of-the-light-source/m-p/13513287#M25848</guid>
      <dc:creator>_1996jackma</dc:creator>
      <dc:date>2019-12-17T12:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the code to set the position of the light source</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-the-code-to-set-the-position-of-the-light-source/m-p/13513288#M25849</link>
      <description>&lt;P&gt;You can set the location and rotation the same way as any other object in the model.&lt;/P&gt;&lt;P&gt;Here is one solution for you:&lt;/P&gt;&lt;PRE&gt;Object tempLight = Model.find("DirectionalLight1");
Vec3 tempVec;
tempVec.x = tempLight.location.x+1;
tempVec.y = tempLight.location.y+1;
tempVec.z = tempLight.location.z;
tempLight.location = tvec;&lt;/PRE&gt;&lt;P&gt;Here is another that does not use the Vec3 variable type:&lt;/P&gt;&lt;PRE&gt;Object tempLight = Model.find("DirectionalLight1");
tempLight.location.x += 1;
tempLight.location.y += 1;&lt;/PRE&gt;&lt;P&gt;I hope one of these works for you, Brandon&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 14:22:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-the-code-to-set-the-position-of-the-light-source/m-p/13513288#M25849</guid>
      <dc:creator>Brandon_Peterson</dc:creator>
      <dc:date>2019-12-17T14:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the code to set the position of the light source</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-the-code-to-set-the-position-of-the-light-source/m-p/13513289#M25850</link>
      <description>&lt;P&gt;Brandon's solution works if you have Light objects in your model in FlexSim 2020 or later.&lt;/P&gt;&lt;P&gt;If you are using an earlier version of FlexSim or you aren't using Light objects, then you can modify the values of the view's light sources.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24313-move-light-source.gif"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500869iC34202B2E6C370E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="24313-move-light-source.gif" alt="24313-move-light-source.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;Object current = ownerobject(c);
treenode view = param(1);

treenode light = first(viewlights(view));
double x = fmod(time(), 10.0) - 5.0;
double y = -1.10;
double z = 1.5;
set(rank(light, 1), x);
set(rank(light, 2), y);
set(rank(light, 3), z);&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Dec 2019 15:52:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-the-code-to-set-the-position-of-the-light-source/m-p/13513289#M25850</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2019-12-17T15:52:47Z</dc:date>
    </item>
  </channel>
</rss>

