Announcements

Community notifications may experience intermittent interruptions between 10–12 November during scheduled maintenance. We appreciate your patience.

Need macro command for a set value in the surface default tab

Need macro command for a set value in the surface default tab

iamcdn79
Mentor Mentor
1,769 Views
5 Replies
Message 1 of 6

Need macro command for a set value in the surface default tab

iamcdn79
Mentor
Mentor

I am trying to make a macro that takes a set value from the surface default tab of set 5 and uses the radial thickness value only as my curve thickness for 2D curve Profile but I get an error. 

 

I don't know what that command would be and if it would be REAL or STRING.

 

Real overburn= EDIT THICKNESS DEFAULTLIST UPDATE\r 5 NEW 

IMPORT TEMPLATE ENTITY TOOLPATH TMPLTSELECTORGUI "Curve-Machining/2D-Curve-Profile.003.ptf"

EDIT PAR 'CurveThickness' $overburn

EDIT PAR 'Tolerance' ".001"
EDIT PAR 'AreaClearance.Rest.Active' '0'
EDIT PAR 'AreaClearance.Profile.CutDirection' 'climb'
EDIT PAR 'Thickness' "0"
STRING pattern = $entity('pattern','').name
$toolpath.Pattern = $pattern

 

iamcdn79_0-1680616297438.png

 

 


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

0 Likes
Accepted solutions (1)
1,770 Views
5 Replies
Replies (5)
Message 2 of 6

kukelyk
Advisor
Advisor

As I remember, the last row can cause error, instead of

$toolpath.Pattern = $pattern

 try 

EDIT PAR "Pattern" $pattern

 at least older versions of pmill.

0 Likes
Message 3 of 6

old_snickers
Advocate
Advocate

I found something interesting here by looking for how to capture the RGB-values of a surface...

Try this instead of your first line:

 


REAL overburn = 0
EDIT THICKNESS DEFAULTLIST UPDATE\r 5 NEW

// Capture the value using a tracefile into file C:\Temp\thickness.txt
ECHO OFF DCPDEBUG UNTRACE COMMAND ACCEPT
TRACEFILE OPEN "C:\Temp\thickness.txt"
PRINT formvalue Thickness.Shell.ThickDef.Radial
TRACEFILE CLOSE

// Read the first line of the Tracefile into variable $overburn
FILE OPEN "C:\Temp\thickness.txt" FOR READ AS input
FILE READ $overburn FROM input
FILE CLOSE input

EDIT PAR 'CurveThickness' $overburn

Message 4 of 6

kevin.hammond3WX4X
Advocate
Advocate
Accepted solution

Replace your first line with this

 

EDIT THICKNESS DEFAULTLIST UPDATE\r 5 NEW
Real Overburn = $widget("Thickness.Shell.ThickDef.Radial").value

 

 

Message 5 of 6

iamcdn79
Mentor
Mentor

@kukelyk wrote:

As I remember, the last row can cause error, instead of

 

$toolpath.Pattern = $pattern

 

 try 

 

EDIT PAR "Pattern" $pattern

 

 at least older versions of pmill.


In 2023 that's no problem


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

0 Likes
Message 6 of 6

old_snickers
Advocate
Advocate

That's very much cleaner 👍! Tomorrow I'll try this method with my RGB-issue also.

0 Likes