<?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 Betreff: [macro]Function library file in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-function-library-file/m-p/12730223#M1901</link>
    <description>&lt;P&gt;I dont think the library should contain a main method&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the .inc file(Library)&lt;/P&gt;&lt;LI-CODE lang="general"&gt;function DoSomething(entity $tp) {
	//Code
}

function DoSomeOtherThings(string $input) {
	//Code
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the macro&lt;/P&gt;&lt;LI-CODE lang="general"&gt;include myfunctions.inc
function Main() {
	foreach $tp in folder('toolpath') {
		call DoSomething($tp)
	}
}&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 24 Apr 2024 11:46:08 GMT</pubDate>
    <dc:creator>icse</dc:creator>
    <dc:date>2024-04-24T11:46:08Z</dc:date>
    <item>
      <title>[macro]Function library file</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-function-library-file/m-p/12730198#M1900</link>
      <description>&lt;P&gt;Hello PowerMill Community,&lt;/P&gt;&lt;P&gt;I'm currently working on improving the efficiency of my workflow by centralizing all my functions into a few library files. The goal is to be able to call these functions as needed across various macros I’m developing.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue Encountered:&lt;/STRONG&gt; I load the library file at the start of each macro by using an include statement, but I’m encountering an issue where the main function of the library file enters a loop, repeating indefinitely no matter what I code inside the main function.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Objective:&lt;/STRONG&gt; My aim is to have a centralized library of functions that I can easily call from, which would significantly streamline the process of developing and maintaining macros.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt; Is there a workaround or a method within PowerMill that allows for the effective use of function libraries without the main function looping? Any guidance or tips on how to implement this would be greatly appreciated as it would simplify my new workflow system.&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 11:29:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-function-library-file/m-p/12730198#M1900</guid>
      <dc:creator>dan_mickle</dc:creator>
      <dc:date>2024-04-24T11:29:56Z</dc:date>
    </item>
    <item>
      <title>Betreff: [macro]Function library file</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-function-library-file/m-p/12730223#M1901</link>
      <description>&lt;P&gt;I dont think the library should contain a main method&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the .inc file(Library)&lt;/P&gt;&lt;LI-CODE lang="general"&gt;function DoSomething(entity $tp) {
	//Code
}

function DoSomeOtherThings(string $input) {
	//Code
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the macro&lt;/P&gt;&lt;LI-CODE lang="general"&gt;include myfunctions.inc
function Main() {
	foreach $tp in folder('toolpath') {
		call DoSomething($tp)
	}
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Apr 2024 11:46:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-function-library-file/m-p/12730223#M1901</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2024-04-24T11:46:08Z</dc:date>
    </item>
    <item>
      <title>Betreff: [macro]Function library file</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-function-library-file/m-p/12730299#M1902</link>
      <description>&lt;P&gt;If I try to call a file with functions and no main function, it errors out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: Nevermind, I'm dumb. The file that's calling the function needs to have the main function, the function library doesn't need to have a main function&lt;/P&gt;&lt;P&gt;I structured it like this and it worked.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;include testFunctionLibrary
function main() {
message info "test"
call resetBlockForm()
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 12:18:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-function-library-file/m-p/12730299#M1902</guid>
      <dc:creator>dan_mickle</dc:creator>
      <dc:date>2024-04-24T12:18:55Z</dc:date>
    </item>
  </channel>
</rss>

