<?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: Macro Z values of the flat surfaces in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964457#M21761</link>
    <description>&lt;P&gt;It works fine,&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2018 08:35:36 GMT</pubDate>
    <dc:creator>Mikhail_Voronin</dc:creator>
    <dc:date>2018-04-27T08:35:36Z</dc:date>
    <item>
      <title>Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7956477#M21750</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As title says i want to make a macro for get the Z values of the flat surfaces.&lt;/P&gt;&lt;P&gt;For the moment only have the flat surfaces selected.&lt;/P&gt;&lt;P&gt;Some one can help me to continue ,please?&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kind regards.&lt;/P&gt;&lt;P&gt;Macro:&lt;/P&gt;&lt;P&gt;EDIT MODEL ALL SELECT FLAT&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 18:29:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7956477#M21750</guid>
      <dc:creator>lopezerik73</dc:creator>
      <dc:date>2018-04-24T18:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7957594#M21751</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4674230"&gt;@lopezerik73&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You want to get the Z values in an external file?&lt;/P&gt;
&lt;P&gt;Please try to use the macro in attachment file and say me if it's&amp;nbsp;working as&amp;nbsp;you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 07:08:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7957594#M21751</guid>
      <dc:creator>jean-baptiste.bannerot</dc:creator>
      <dc:date>2018-04-25T07:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7957981#M21752</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4034495"&gt;@jean-baptiste.bannerot&lt;/a&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First at all thanks for answer.&lt;/P&gt;&lt;P&gt;About get the data in external file is not necesary at all.&lt;/P&gt;&lt;P&gt;But , i have a problem, when execute the macro i have error in line 24 :&amp;nbsp;&lt;U&gt;EDIT MODEL ALL SELECT $Surf.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Don´t know what is the problem.&lt;/P&gt;&lt;P&gt;Many thanks for ty to help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 10:03:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7957981#M21752</guid>
      <dc:creator>lopezerik73</dc:creator>
      <dc:date>2018-04-25T10:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7957990#M21753</link>
      <description>Please can you send me a screen shot of the error box ?</description>
      <pubDate>Wed, 25 Apr 2018 10:07:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7957990#M21753</guid>
      <dc:creator>jean-baptiste.bannerot</dc:creator>
      <dc:date>2018-04-25T10:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7958020#M21754</link>
      <description>&lt;P&gt;Sorry, now i test in other part file and works fine. &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.autodesk.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Is posible to sort this values&amp;nbsp; min to max?&lt;/P&gt;&lt;P&gt;Many thanks and sorry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kind regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Z_Values.JPG" style="width: 589px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/492999i1D0DE6BAF1419753/image-size/large?v=v2&amp;amp;px=999" role="button" title="Z_Values.JPG" alt="Z_Values.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 10:27:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7958020#M21754</guid>
      <dc:creator>lopezerik73</dc:creator>
      <dc:date>2018-04-25T10:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7958228#M21755</link>
      <description>&lt;P&gt;Ok perfect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes you can find in the documentation all macro function :&amp;nbsp;"C:\Program Files\Autodesk\&amp;lt;PowerMill version&amp;gt;\lib\locale\C\HELP\Pmill.chm".&lt;/P&gt;
&lt;P&gt;You can use extract all value from a list. Be carrefull, the macro used a string list and to extract value you need to use a real list.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 11:59:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7958228#M21755</guid>
      <dc:creator>jean-baptiste.bannerot</dc:creator>
      <dc:date>2018-04-25T11:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7958245#M21756</link>
      <description>&lt;P&gt;Ok, many thanks.&lt;/P&gt;&lt;P&gt;I think for the moment i use it as you do, because i haven´t enough knowledge for the moment to modify.&lt;/P&gt;&lt;P&gt;Many thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 12:07:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7958245#M21756</guid>
      <dc:creator>lopezerik73</dc:creator>
      <dc:date>2018-04-25T12:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964320#M21757</link>
      <description>&lt;P&gt;Hi Jean-Baptiste,&lt;/P&gt;&lt;P&gt;I have a little problem with the macro&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-04-27_09-56-17.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/494046i2C8DFA19E9279238/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-04-27_09-56-17.png" alt="2018-04-27_09-56-17.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 07:27:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964320#M21757</guid>
      <dc:creator>Mikhail_Voronin</dc:creator>
      <dc:date>2018-04-27T07:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964347#M21758</link>
      <description>Hi Mikhail,&lt;BR /&gt;Ok what is the problem ? How can I help you ?&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Apr 2018 07:41:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964347#M21758</guid>
      <dc:creator>jean-baptiste.bannerot</dc:creator>
      <dc:date>2018-04-27T07:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964380#M21759</link>
      <description>&lt;P&gt;If PowerMILL doesn't have an English interface the macro doesn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 07:57:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964380#M21759</guid>
      <dc:creator>Mikhail_Voronin</dc:creator>
      <dc:date>2018-04-27T07:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964431#M21760</link>
      <description>&lt;P&gt;Ok I've find the problem.&lt;/P&gt;
&lt;P&gt;Please try with this new version of the macro.&lt;/P&gt;
&lt;P&gt;Jean-Baptiste&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 08:24:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964431#M21760</guid>
      <dc:creator>jean-baptiste.bannerot</dc:creator>
      <dc:date>2018-04-27T08:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964457#M21761</link>
      <description>&lt;P&gt;It works fine,&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 08:35:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964457#M21761</guid>
      <dc:creator>Mikhail_Voronin</dc:creator>
      <dc:date>2018-04-27T08:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964546#M21762</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3969173"&gt;@Mikhail_Voronin&lt;/a&gt; don't forget to approve the solution;)&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 09:19:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7964546#M21762</guid>
      <dc:creator>jean-baptiste.bannerot</dc:creator>
      <dc:date>2018-04-27T09:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7969256#M21763</link>
      <description>&lt;P&gt;Even in non-English interface, it should work.&lt;BR /&gt;It is also fast.&lt;/P&gt;&lt;PRE&gt;function main() {
	//Please set a temporary file path
	string tracepath = 'c:\tmp\sel_surfs.txt'
	
	EDIT MODEL ALL DESELECT ALL
	EDIT MODEL ALL SELECT FLAT
	
	string list surfs = {}
	call GetFlatFacesName($tracepath, $surfs)
	if size($surfs) &amp;lt; 1 {
		message warn 'Horizontal plane can not be found!'
		return
	}

	string list zlevel = {}
	call GetZLevelList($surfs, $zlevel)
	
	string $msg = 'Flat surfaces Z value :' + crlf + join(zlevel, crlf)
	message info $msg
}

//高さリスト取得
function GetZLevelList(string list surfs, output string list out) {
	$out = {}
	
	UNDRAW BLOCK
	EDIT BLOCKTYPE BOX
	EDIT BLOCK COORDINATE WORKPLANE
	EDIT PAR powermill.Options.Block.UseReferenceModel 0
	
	EDIT BLOCK ALL UNLOCK
	EDIT BLOCK TOLERANCE '0.01'
	EDIT BLOCK RESETLIMIT '0'
	EDIT BLOCK LIMITTYPE MODEL
	
	string list pros = {}
	int dmy = 0
	string face = ''
	GRAPHICS LOCK
	foreach s in $surfs {
		EDIT MODEL ALL DESELECT ALL
		$face = RTRIM($s)
		EDIT MODEL ALL SELECT $face
		
		EDIT BLOCK RESET
		$dmy = add_last($out, string(round($Block.Limits.ZMin,3)))
	}
	GRAPHICS UNLOCK
	EDIT MODEL ALL DESELECT ALL
	
	$dmy = remove_duplicates($out )
	$out = reverse(sort($out ))
}

//水平面名取得
function GetFlatFacesName(string tracepath, output string list out) {
	$out = {}
	
	ECHO OFF DCPDEBUG UNTRACE COMMAND ACCEPT
	tracefile open $tracepath
	print SELSURFACE
	tracefile close
	ECHO ON DCPDEBUG TRACE COMMAND ACCEPT
	
	file open $tracepath for read as 's'
	file read $out  from 's'
	file close 's'
	delete file $tracepath

	int dmy = remove_first($out )
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Apr 2018 11:20:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7969256#M21763</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2018-04-30T11:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7969403#M21764</link>
      <description>&lt;P&gt;I think I'm getting the same error&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4674230"&gt;@lopezerik73&lt;/a&gt; was. Please see attached. Using version 2018&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="macro_error.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/494918iA45CCA31F51B3769/image-size/large?v=v2&amp;amp;px=999" role="button" title="macro_error.png" alt="macro_error.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 12:33:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7969403#M21764</guid>
      <dc:creator>jelrod</dc:creator>
      <dc:date>2018-04-30T12:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7973683#M21765</link>
      <description>&lt;P&gt;Nice solution&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I would just&amp;nbsp;change in your code the location of the temporary tracefile into&amp;nbsp; &amp;nbsp;:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	// Temporary file path
	STRING $TraceFilePath = MACRO_PATH(false) + "\Tracefile.txt"&lt;/PRE&gt;&lt;P&gt;like that you are not dependent of the configuration of your post with a hard coded path.&amp;nbsp; &amp;nbsp;GetFlatFacesName&amp;nbsp; could be write like that :&lt;/P&gt;&lt;PRE&gt;FUNCTION GetFlatFacesName(OUTPUT STRING LIST Surf) {

	// Temporary file path
	STRING $TraceFilePath = MACRO_PATH(false) + "\Tracefile.txt"
	
	$Surf = {}
	
	ECHO OFF DCPDEBUG UNTRACE COMMAND ACCEPT
	TRACEFILE OPEN $TraceFilePath
	PRINT SELSURFACE
	TRACEFILE CLOSE
	ECHO ON DCPDEBUG TRACE COMMAND ACCEPT
	
	FILE OPEN $TraceFilePath FOR READ AS Input
	FILE READ $Surf FROM Input
	FILE CLOSE Input
	DELETE FILE $TraceFilePath

	INT Ret = REMOVE_FIRST($Surf)
}&lt;/PRE&gt;&lt;P&gt;herewith same macro with block reset&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 09:14:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7973683#M21765</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2018-05-02T09:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Z values of the flat surfaces</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7974272#M21766</link>
      <description>&lt;P&gt;Thanks 5axes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also learned a lot.&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 13:33:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-z-values-of-the-flat-surfaces/m-p/7974272#M21766</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2018-05-02T13:33:44Z</dc:date>
    </item>
  </channel>
</rss>

