<?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 Project folder in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11531961#M5134</link>
    <description>&lt;P&gt;Could anyone help me find a solution to my problem. in the macro below it takes me only to the main directory, but I would like to go further and select the folders that are inside them, I will use this macro to save the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STRING dirPadrao = "C:\Users\09689322\Desktop\Projetos PowerMill\" //alterar o diretório padrão de projetos&lt;BR /&gt;&lt;BR /&gt;STRING $mName = folder("model")[0].Name&lt;BR /&gt;STRING LIST $List_dir = list_files('dirs', $dirPadrao)&lt;BR /&gt;INT $Felipe = INPUT CHOICE $List_dir "Selecione o diretório."&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2022 20:38:09 GMT</pubDate>
    <dc:creator>Felipe_Callegario</dc:creator>
    <dc:date>2022-11-04T20:38:09Z</dc:date>
    <item>
      <title>Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11531961#M5134</link>
      <description>&lt;P&gt;Could anyone help me find a solution to my problem. in the macro below it takes me only to the main directory, but I would like to go further and select the folders that are inside them, I will use this macro to save the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STRING dirPadrao = "C:\Users\09689322\Desktop\Projetos PowerMill\" //alterar o diretório padrão de projetos&lt;BR /&gt;&lt;BR /&gt;STRING $mName = folder("model")[0].Name&lt;BR /&gt;STRING LIST $List_dir = list_files('dirs', $dirPadrao)&lt;BR /&gt;INT $Felipe = INPUT CHOICE $List_dir "Selecione o diretório."&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 20:38:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11531961#M5134</guid>
      <dc:creator>Felipe_Callegario</dc:creator>
      <dc:date>2022-11-04T20:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11532048#M5135</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8164322"&gt;@Felipe_Callegario&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to access these sub folders then simply use&lt;/P&gt;&lt;P&gt;list_files('dirs&lt;STRONG&gt;+&lt;/STRONG&gt;', $dirPadrao)&lt;/P&gt;&lt;P&gt;instead of&lt;/P&gt;&lt;P&gt;list_files('dirs', $dirPadrao)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is an example to show the difference between them, for the following directory:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Temp.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1136381i0546B7619C00552D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Temp.png" alt="Temp.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;STRING SearchPath = "C:\Users\hp\Desktop\TestFolder"
STRING LIST FoldersList = list_files("dirs", SearchPath)
FOREACH file in FoldersList {
PRINT $file
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will return only return this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder1&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder2&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder3&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While this one:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;STRING SearchPath = "C:\Users\hp\Desktop\TestFolder"
STRING LIST FoldersList = list_files("dirs+", SearchPath)
FOREACH file in FoldersList {
PRINT $file
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;will include the sub folders:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder1&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder1/a&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder1/b&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder2&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder2/1&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder2/2&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder3&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder3/c&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;C:/Users/hp/Desktop/TestFolder/TestFolder3/d&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that my reply is helpful to you.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 21:54:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11532048#M5135</guid>
      <dc:creator>Y.Mahran</dc:creator>
      <dc:date>2022-11-04T21:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11532081#M5136</link>
      <description>&lt;P&gt;First of all I would like to thank you for your answer, but what I need is to be able to choose the folders for me to get to the folder where I want to save the projects.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 22:28:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11532081#M5136</guid>
      <dc:creator>Felipe_Callegario</dc:creator>
      <dc:date>2022-11-04T22:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11547673#M5137</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8164322"&gt;@Felipe_Callegario&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It seems like you want to "Save As" the project according to the model name &amp;amp; current date (modelName_dd-mm-yyyy), into a certain folder.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;The following macro lists the folders in the project directory and asks you to choose the folder to "Save As" the project into.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6315431833112w600h326r516" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6315431833112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6315431833112w600h326r516');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6315431833112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that this macro is helpful to you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;// Initializing some variables
RESET LOCALVARS 
STRING mainDirectory = dirname(project_pathname(0), "/")
STRING LIST foldersPathList = list_files("dirs", mainDirectory)


// looping over folders
BOOl matchFound = 0
WHILE (True) {
	// Asking the user to choose a folder to "Save As" the project into
	INT C = INPUT CHOICE $foldersPathList "Choose a folder: "
	STRING choosenFolderPath = foldersPathList[C]
	STRING choosenFolderName = basename(choosenFolderPath, "/")
	STRING queryMsg = "The choosen folder: " + choosenFolderName + crlf + "Yes = Confirm" + crlf + "No = Choose a Sub-Folder"
	$matchFound = Query $queryMsg
	
	// Asking the user whether to confirm the choosen folder or explore sub-folders
	// If the user confirms the choice, then, the macro "Save As" the project using the model name &amp;amp; current date
	IF ($matchFound) {
		OBJECT time = local_time(time())
		STRING currentDate = time.day + "-" + time.month + "-" + time.year
		ENTITY LIST myModel = folder("Model")[0]
		STRING projectSaveName = myModel.Name + "_" + currentDate
		CD $choosenFolderPath
		PROJECT SAVE AS $projectSaveName
		BREAK  
	} ELSE {
		$foldersPathList = list_files("dirs", choosenFolderPath)
		IF is_empty(foldersPathList) {
		  MESSAGE ERROR "There is no sub-folder in (" + choosenFolderName + ")"
		  MACRO ABORT
		}
	}
} &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2022 07:52:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11547673#M5137</guid>
      <dc:creator>Y.Mahran</dc:creator>
      <dc:date>2022-11-12T07:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11547910#M5138</link>
      <description>&lt;P&gt;Excellent, thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2022 13:06:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11547910#M5138</guid>
      <dc:creator>Felipe_Callegario</dc:creator>
      <dc:date>2022-11-12T13:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11577186#M5139</link>
      <description>&lt;P&gt;Is there a way to list the files that have been run to export the nc program?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="phucx6c_0-1669362438286.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1144246iEA6737223123B610/image-size/medium?v=v2&amp;amp;px=400" role="button" title="phucx6c_0-1669362438286.png" alt="phucx6c_0-1669362438286.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 07:48:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/11577186#M5139</guid>
      <dc:creator>phocvet</dc:creator>
      <dc:date>2022-11-25T07:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/12706856#M5140</link>
      <description>&lt;P&gt;Nice macro, how do i change the default directory?&lt;/P&gt;&lt;P&gt;the macro show everthing in c:\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to d:\projects&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 21:42:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/12706856#M5140</guid>
      <dc:creator>nubrandao</dc:creator>
      <dc:date>2024-04-13T21:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/12706857#M5141</link>
      <description>&lt;P&gt;how do i change directory to d:\Project&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 21:43:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/12706857#M5141</guid>
      <dc:creator>nubrandao</dc:creator>
      <dc:date>2024-04-13T21:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Project folder</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/12710240#M5142</link>
      <description>&lt;P&gt;Just today I saw your request, you must enter your directory replacing where I will leave it demarcated. "mainDirectory"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;// Initializing some variables&lt;/DIV&gt;&lt;DIV&gt;RESET LOCALVARS&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;STRING mainDirectory = dirname(project_pathname(0), "/")&lt;/DIV&gt;&lt;DIV&gt;STRING LIST foldersPathList = list_files("dirs", &lt;U&gt;mainDirectory&lt;/U&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;// looping over folders&lt;/DIV&gt;&lt;DIV&gt;BOOl matchFound = 0&lt;/DIV&gt;&lt;DIV&gt;WHILE (True) {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Asking the user to choose a folder to "Save As" the project into&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;INT C = INPUT CHOICE $foldersPathList "Choose a folder: "&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;STRING choosenFolderPath = foldersPathList[C]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;STRING choosenFolderName = basename(choosenFolderPath, "/")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;STRING queryMsg = "The choosen folder: " + choosenFolderName + crlf + "Yes = Confirm" + crlf + "No = Choose a Sub-Folder"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$matchFound = Query $queryMsg&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Asking the user whether to confirm the choosen folder or explore sub-folders&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// If the user confirms the choice, then, the macro "Save As" the project using the model name &amp;amp; current date&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF ($matchFound) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;OBJECT time = local_time(time())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;STRING currentDate = time.day + "-" + time.month + "-" + time.year&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ENTITY LIST myModel = folder("Model")[0]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;STRING projectSaveName = myModel.Name + "_" + currentDate&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CD $choosenFolderPath&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PROJECT SAVE AS $projectSaveName&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BREAK&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} ELSE {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$foldersPathList = list_files("dirs", choosenFolderPath)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF is_empty(foldersPathList) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; MESSAGE ERROR "There is no sub-folder in (" + choosenFolderName + ")"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; MACRO ABORT&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 15 Apr 2024 18:50:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-folder/m-p/12710240#M5142</guid>
      <dc:creator>Felipe_Callegario</dc:creator>
      <dc:date>2024-04-15T18:50:27Z</dc:date>
    </item>
  </channel>
</rss>

