<?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: Generate AGV paths from coordinates in an imported Excel file in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512834#M25520</link>
    <description>&lt;P&gt;There are no commands to do it. The view does it through edit modes. You could try to replicate the edit modes, but I couldn't get it to work. Here is some code for a user command that might be able to get you started, but that I can't get to work correctly for the curved parts:&lt;/P&gt;&lt;PRE&gt;/**Custom Code*/
Vec3 point1 = Vec3(param(1), param(2), param(3));
Vec3 point2 = Vec3(param(4), param(5), param(6));
int isCurved = param(7);
int xFirst = isCurved &amp;amp;&amp;amp; param(7) == 1;
treenode view = param(8);

treenode agvNetwork = node("/AGVNetwork", model());
treenode container = agvNetwork;
if (!objectexists(container))
	container = model();

string className = isCurved ? "AGV::CurvedPath" : "AGV::StraightPath";
int appendNr = 1;
string name = "Path";
while (objectexists(node(concat(name, numtostring(appendNr, 0, 0)), agvNetwork)))
	appendNr++;
	
treenode theClass = findmatchintree(library(), getname(first(classes(a))) == className);
if (!objectexists(theClass))
	return 0;
		
treenode path = setname(createinstance(theClass, container), concat(name, numtostring(appendNr, 0, 0)));
set(spatialsx(path), 0);
setcenter(path, point1.x, point1.y, point1.z + 0.5 * zsize(path));

setselectedobject(view, path);
if (xFirst) {
	function_s(path, "dragEnd", point2.x, point1.y, point1.z, view);
} else {
	function_s(path, "dragEnd", point1.x, point2.y, point1.z, view);
}
function_s(path, "dragEnd", point2.x, point2.y, point2.z, view);
function_s(path, "finalizeSpatialChanges", view);
&lt;/PRE&gt;&lt;P&gt;And here's an example using that code:&lt;/P&gt;&lt;PRE&gt;treenode view = node("VIEW:/active/MainPanel/BackPanel/SplitterXPane/SplitterYPane/TabPane/TabControl/Perspective&amp;gt;viewwindowtype/Perspective/1/../../..");
createAGVPath(0, 0, 0, 5, 0, 0, 0, view);
createAGVPath(5, 0, 0, 6, 1, 0, 2, view);
createAGVPath(6, 1, 0, 6, 2, 0, 0, view);
createAGVPath(6, 2, 0, 5, 3, 0, 1, view); // This curve doesn't work right
&lt;/PRE&gt;&lt;P&gt;Note that it requires the active view. Also note that I can't guarantee that this approach will really work long term, because it isn't designed for people to do this outside the drag-drop interface. But good luck!&lt;/P&gt;</description>
    <pubDate>Mon, 23 Apr 2018 23:04:19 GMT</pubDate>
    <dc:creator>JordanLJohnson</dc:creator>
    <dc:date>2018-04-23T23:04:19Z</dc:date>
    <item>
      <title>Generate AGV paths from coordinates in an imported Excel file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512833#M25519</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I'd like to generate AGV paths from coordinates in an imported Excel file.&lt;/P&gt;&lt;P&gt;Are there commands to create paths from code for example: createpath(x1,y1,z1,x2,y2,z2,a,b,c)?&lt;/P&gt;&lt;P&gt;I can't find such a command.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 18:16:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512833#M25519</guid>
      <dc:creator>patrickABAWF</dc:creator>
      <dc:date>2018-04-21T18:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generate AGV paths from coordinates in an imported Excel file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512834#M25520</link>
      <description>&lt;P&gt;There are no commands to do it. The view does it through edit modes. You could try to replicate the edit modes, but I couldn't get it to work. Here is some code for a user command that might be able to get you started, but that I can't get to work correctly for the curved parts:&lt;/P&gt;&lt;PRE&gt;/**Custom Code*/
Vec3 point1 = Vec3(param(1), param(2), param(3));
Vec3 point2 = Vec3(param(4), param(5), param(6));
int isCurved = param(7);
int xFirst = isCurved &amp;amp;&amp;amp; param(7) == 1;
treenode view = param(8);

treenode agvNetwork = node("/AGVNetwork", model());
treenode container = agvNetwork;
if (!objectexists(container))
	container = model();

string className = isCurved ? "AGV::CurvedPath" : "AGV::StraightPath";
int appendNr = 1;
string name = "Path";
while (objectexists(node(concat(name, numtostring(appendNr, 0, 0)), agvNetwork)))
	appendNr++;
	
treenode theClass = findmatchintree(library(), getname(first(classes(a))) == className);
if (!objectexists(theClass))
	return 0;
		
treenode path = setname(createinstance(theClass, container), concat(name, numtostring(appendNr, 0, 0)));
set(spatialsx(path), 0);
setcenter(path, point1.x, point1.y, point1.z + 0.5 * zsize(path));

setselectedobject(view, path);
if (xFirst) {
	function_s(path, "dragEnd", point2.x, point1.y, point1.z, view);
} else {
	function_s(path, "dragEnd", point1.x, point2.y, point1.z, view);
}
function_s(path, "dragEnd", point2.x, point2.y, point2.z, view);
function_s(path, "finalizeSpatialChanges", view);
&lt;/PRE&gt;&lt;P&gt;And here's an example using that code:&lt;/P&gt;&lt;PRE&gt;treenode view = node("VIEW:/active/MainPanel/BackPanel/SplitterXPane/SplitterYPane/TabPane/TabControl/Perspective&amp;gt;viewwindowtype/Perspective/1/../../..");
createAGVPath(0, 0, 0, 5, 0, 0, 0, view);
createAGVPath(5, 0, 0, 6, 1, 0, 2, view);
createAGVPath(6, 1, 0, 6, 2, 0, 0, view);
createAGVPath(6, 2, 0, 5, 3, 0, 1, view); // This curve doesn't work right
&lt;/PRE&gt;&lt;P&gt;Note that it requires the active view. Also note that I can't guarantee that this approach will really work long term, because it isn't designed for people to do this outside the drag-drop interface. But good luck!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 23:04:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512834#M25520</guid>
      <dc:creator>JordanLJohnson</dc:creator>
      <dc:date>2018-04-23T23:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Generate AGV paths from coordinates in an imported Excel file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512835#M25521</link>
      <description>&lt;P&gt;
	You can create AGV paths the same way you create other objects: using createinstance(). See: &lt;A href="https://answers.flexsim.com/questions/32299/how-to-create-and-join-avg-paths-in-flexscript.html"&gt;How to create and join AVG paths in flexscript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;
	For example, the following code creates a straight path and a curved path:&lt;/P&gt;
&lt;PRE&gt;treenode path1 = createinstance(node("/AGV/StraightPath",library()),model());
setsize(path1,3,1,1);
setloc(path1,1,0,0);
function_s(path1, "finalizeSpatialChanges");

treenode path2 = createinstance(node("/AGV/CurvedPath",library()),model());
setloc(path2,4,1,0);
setvarnum(path2, "radius", 1);
setvarnum(path2, "startAngle", -90);
setvarnum(path2, "sweepAngle", 90);
function_s(path2, "finalizeSpatialChanges");
&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="11625-create-paths.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1496902i57F8AC3F964F9A6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="11625-create-paths.png" alt="11625-create-paths.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 14:51:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512835#M25521</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2018-04-24T14:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Generate AGV paths from coordinates in an imported Excel file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512836#M25522</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/240/patrick.c.html" nodeid="240"&gt;@Patrick Cloutier&lt;/A&gt;, did either of these solutions work for you?&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 18:01:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512836#M25522</guid>
      <dc:creator>emily_hardySTLSK</dc:creator>
      <dc:date>2018-05-24T18:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Generate AGV paths from coordinates in an imported Excel file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512837#M25523</link>
      <description>&lt;P&gt;This was a question from a potential client who wants to buy Flexsim.  I only needed to know if it can be done.  Since I was pretty confident that one of these methods will work I told him YES.&lt;/P&gt;&lt;P&gt;But I didn't try these.  Yet.&lt;/P&gt;&lt;P&gt;So I don't know which answer to accept.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 18:06:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512837#M25523</guid>
      <dc:creator>patrickABAWF</dc:creator>
      <dc:date>2018-05-24T18:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Generate AGV paths from coordinates in an imported Excel file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512838#M25524</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;An approach using Table.query()  to insert objects can be found &lt;A href="https://answers.flexsim.com/questions/145776/import-and-export.html?childToView=145783#answer-145783"&gt;here&lt;/A&gt; for conveyors - AGV paths are similar and should be able to use the same arc functions described there.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Jun 2024 13:54:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/generate-agv-paths-from-coordinates-in-an-imported-excel-file/m-p/13512838#M25524</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-06-25T13:54:51Z</dc:date>
    </item>
  </channel>
</rss>

