<?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: project saving macro in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12440504#M2670</link>
    <description>&lt;P&gt;try this:&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;LI-CODE lang="general"&gt;string $path = "C:\Users\Andrea\Desktop"

if not dir_exists($path) {
	message info "path does not exists"
	return
}

string $modelName = folder('model')[0].Name

if length($modelName) &amp;lt; 8 {
	return
}

if not entity_exists('ncprogram', substring($modelName,0,8)) {
	CREATE NCPROGRAM ${substring($modelName,0,8)}
}
 
$path = $path + "\" + substring($modelName,0,8)

if dir_exists($path) {
	message info "Project already exists"
	return
}

PROJECT SAVE AS FILESAVE $path&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Dec 2023 13:01:15 GMT</pubDate>
    <dc:creator>icse</dc:creator>
    <dc:date>2023-12-19T13:01:15Z</dc:date>
    <item>
      <title>project saving macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12439306#M2667</link>
      <description>&lt;P&gt;Hi everyone&lt;BR /&gt;I need your help to create a macro to save the powermill project.&lt;BR /&gt;in particular you should take the first 8 characters of the name of the imported model and use them to save the powermill project with a name.&lt;BR /&gt;my interest is that the macro works like the "save" command when first saving the powermill project.&lt;BR /&gt;with the same macro I would also like to create the NC program with the same name as the powermill project.&lt;BR /&gt;Can something like this be achieved?&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 17:38:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12439306#M2667</guid>
      <dc:creator>g_borri</dc:creator>
      <dc:date>2023-12-13T17:38:46Z</dc:date>
    </item>
    <item>
      <title>Betreff: project saving macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12439432#M2668</link>
      <description>&lt;P&gt;Where do you want to save the Powermill project? Is it always the same path?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 18:46:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12439432#M2668</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2023-12-13T18:46:58Z</dc:date>
    </item>
    <item>
      <title>Betreff: project saving macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12440493#M2669</link>
      <description>&lt;P&gt;Yes, it's always the same path. "C:\Users\Andrea\Desktop"&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 07:16:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12440493#M2669</guid>
      <dc:creator>g_borri</dc:creator>
      <dc:date>2023-12-14T07:16:12Z</dc:date>
    </item>
    <item>
      <title>Betreff: project saving macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12440504#M2670</link>
      <description>&lt;P&gt;try this:&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;LI-CODE lang="general"&gt;string $path = "C:\Users\Andrea\Desktop"

if not dir_exists($path) {
	message info "path does not exists"
	return
}

string $modelName = folder('model')[0].Name

if length($modelName) &amp;lt; 8 {
	return
}

if not entity_exists('ncprogram', substring($modelName,0,8)) {
	CREATE NCPROGRAM ${substring($modelName,0,8)}
}
 
$path = $path + "\" + substring($modelName,0,8)

if dir_exists($path) {
	message info "Project already exists"
	return
}

PROJECT SAVE AS FILESAVE $path&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 13:01:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12440504#M2670</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2023-12-19T13:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: project saving macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12450162#M2671</link>
      <description>&lt;P&gt;HELLO&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9883755"&gt;@g_borri&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TRY WITH THAT, I HOPE IT WORKS FOR YOUR NECESITIES&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;//EXTRACTING MODEL NAME (FIRST 8 CHARACTERS) AND SAVE THE FILE IF IT DOESN'T EXISTS&lt;/DIV&gt;&lt;DIV&gt;STRING $MODELNAME = FOLDER('model')[0].Name&lt;/DIV&gt;&lt;DIV&gt;STRING $SAVENAME = SUBSTRING($MODELNAME , 0 , 7)&lt;/DIV&gt;&lt;DIV&gt;STRING $SAVEDIRECTORY = "C:\Utenti\CAD22\Desktop\" + $SAVENAME&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;IF NOT DIR_EXISTS($SAVEDIRECTORY) {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PROJECT SAVE AS $SAVEDIRECTORY&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;} ELSE {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PROJECT SAVE&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;//CREATE NCPROGRAM BASE ON MODEL NAME (FIRST 8 CHARACTERS) IF IT DOESN'T EXISTS&lt;/DIV&gt;&lt;DIV&gt;IF NOT ENTITY_EXISTS('NCPROGRAM' , $SAVENAME) {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CREATE NCPROGRAM ; EDIT NCPROGRAM ; QUIT FORM NCTOOLPATH&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RENAME NCPROGRAM # $SAVENAME&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NCTOOLPATH CANCEL FORM ACCEPT NCTOOLPATHLIST FORM ACCEPT NCTOOLLIST FORM ACCEPT PROBINGNCOPTS &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 11:17:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-saving-macro/m-p/12450162#M2671</guid>
      <dc:creator>moraschini</dc:creator>
      <dc:date>2023-12-19T11:17:46Z</dc:date>
    </item>
  </channel>
</rss>

