Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tips & Tricks

94 REPLIES 94
Reply
Message 1 of 95
GlennM.MCAM
14942 Views, 94 Replies

Tips & Tricks

Hi all!

I thought it would be a good idea to post some tips and tricks for certain actions. Some of you will know them, other don't.
Please post as much tips & tricks as you want. Here are mine:

 

 

Since it is not possible to export the stockmodel as a dmt file, I save the viewmill state as dmt and use that as a block.

 

 

If you need a selection of your model and want to save this selection, use this macro:

CREATE LEVEL ; MODELCOMPSET EDIT LEVEL # ACQUIRE SELECTED

Greetings,

Glenn


Intel i7 4790 @ 3.60GHz -16GB RAM - Nvidia Quadro K620 - 250GB SSD - Win 7 Pro x64 SP1
PowerMILL Premium 2019.1 - PowerINSPECT Ultimate OMV 2017 SP6
94 REPLIES 94
Message 61 of 95
Anonymous
in reply to: GlennM.MCAM

Hey Glenn,

 

This Macro works great but I want to create a few If Else statements in here. I am trying to get the macro to decide which folder to place the file in. For example I have folders for each specific job. 6XXXX, 6AXXX, 6BXXX and so on. Right now this macro below will create only a 6XXXX folder and even if the part number is 6HXXX. It creates a directory like: 

C:\Users\zwalker\Desktop\PROGRAMMED ELECTRODES\6XXXX\6H809\B Electrodes.  

 

And I want it to create a directory like this:

C:\Users\zwalker\Desktop\PROGRAMMED ELECTRODES\6HXXX\6H809\B Electrodes. 

 

In the past I have just simply replaced STRING X4 = "XXXX" with STRING X4 = "AXXX"  or STRING X4 = "BXXX" but I would rather not have a bunch of the same macro buttons on my ribbon when I could have one macro that does the deciding for me.

 

I want to be able to have PMILL Create a folder or if it exists already just get into the correct folder to create the correct save path.  I will post pictures below to hopefully better describe the scenario. I am not sure what terms I need to use to make this macro look at the line 16 (below) and have the macro determine whether this is an A, B, C, D or just another number. 

 

STRING PATH2 = Substring("$ModelName", 1, 1)

 

Hopefully this makes sense to you as to what I am trying to accomplish. Thank you!

 

MacroHelp1.JPG

 

STRING LIST models = {}
FOREACH md IN FOLDER('model') {
     IF position($md.name, "Planes") == -1 {
          INT k = add_last($models, $md.name)
     }
}
STRING ModelName = ''
IF size($models) == 1 {
     $ModelName = $models[0]
} ELSE {
     $ModelName = INPUT ENTITY MODEL "Choose model"
}

//Disect Model Name
STRING PATH1 = Substring("$ModelName", 0, 1)
STRING PATH2 = Substring("$ModelName", 1, 1)
STRING PATH3 = Substring("$ModelName", 0, 5)
STRING PATH4 = Substring("$ModelName", 6, 1)
STRING X4 = "XXXX"
STRING X3 = "XXX"
STRING ELECTRODE = $PATH4 + " Electrodes"

//Output path
STRING PATH0 = "C:\Users\zwalker\Desktop\Programmed Electrodes\" + $PATH1 + $X4 + "\" + $PATH3 + "\" + $ELECTRODE + "\" + $ModelName
STRING SaveAs = $PATH0

//if project already exist, just save it.
IF dir_exists($saveas) { 
PROJECT SAVE


//if project doesn't exist, save it as modelname in model location
} ELSE { 
		BOOL NameCheck = FALSE
		STRING $Question = "Is this path and modelname correct?" +CRLF+ $saveas
		$NameCheck = QUERY $Question
		IF $NameCheck {
		PROJECT SAVE AS $saveas 
		STRING $Message = "Project has been saved in" +CRLF+ $saveas
		MESSAGE INFO $Message
		}
	}

 

Message 62 of 95
Anonymous
in reply to: 5axes

oh, sorry - i was run macros as macros

when i assigned macro to button - now it works

 

thanks 5axes!

Message 63 of 95
GlennM.MCAM
in reply to: Anonymous

@Anonymous

Please post this question here because this topic is for tips & tricks Smiley Wink

At this time I don't have the time to work on that macro, but I think the easiest way to answer your question is adding a input dialog where you can manually enter '6', '7B', '8C', ... that will output the specific path OR you could use a list that gives you all the folders where you can select the correct one.

Auto detection macro are (for me) hard to make them bug free.

 

Glenn


Intel i7 4790 @ 3.60GHz -16GB RAM - Nvidia Quadro K620 - 250GB SSD - Win 7 Pro x64 SP1
PowerMILL Premium 2019.1 - PowerINSPECT Ultimate OMV 2017 SP6
Message 64 of 95
Beta_Librae
in reply to: GlennM.MCAM

Would it be possible to have this macro prompt you for the export location?


Kind Regards,
Not cnc, you can call me Peabrain
Message 65 of 95
Beta_Librae
in reply to: kukelyk

Good Morning,

 

Could the exported stockmodel file be directed to a specific/different folder? Could there be a choice for the user at the time of export?


Kind Regards,
Not cnc, you can call me Peabrain
Message 66 of 95
danmic7JH66
in reply to: GlennM.MCAM

I had some help from members on this forum with my rename toolpaths macro and I figured I'd share it if anyone was interested! It starts by assigning a number to each toolpath and clearing out the rest of the name. Then it builds the new name based on tool number, tool diameter, toolpath type, and thickness. Feel free to use it how you see fit if it's helpful to anyone!

STRING RNM = ' '
INT CNT = 0


// CYCLES THROUGH ALL SELECTED PROGRAMS AND CLEARS THE NAME AND ASSIGNS A NUMBER
 FOREACH $Selected_Toolpath IN (explorer_selected_entities()) {
    // Exit if the selected entities are not Toolpaths
    IF $Selected_Toolpath.RootType != "toolpath" {
        BREAK
  }
    MACRO APPERROR CONTINUE

// CLEARS THE TOOLPATH NAME AND ASSIGNS EACH ONE A NUMBER
IF CNT < 10 {
		$RNM = "0" + $CNT + "-" 
	} ELSE {
		$RNM = $CNT + "-"
	}
	
	RENAME Toolpath $Selected_Toolpath $RNM
	$CNT = $CNT + 1
	}
 
	// DETERMINS TOOL DIAMETER AND ADDS THAT TO THE TP NAME
	  
	 FOREACH $Selected_Toolpath IN (explorer_selected_entities()) {
		// Exit if the selected entities are not Toolpaths
		IF $Selected_Toolpath.RootType != "toolpath" {
			BREAK
	  }
		MACRO APPERROR CONTINUE
	ACTIVATE TOOLPATH $Selected_Toolpath

	// TOOLPATH NAME VARIABLE AND TOOLNUMBER VARIABLE
	STRING TPNAME = ENTITY('toolpath','').name
	INT TOONUM = ENTITY('toolpath','').tool.number
	STRING MISSEDTOOLNAME = ENTITY('tool','').name
	STRING TOOLNAME = ' '
	IF $TOONUM < 10 {
	$TOOLNAME = "T00" + $TOONUM + "-"
	} ELSE {
	$TOOLNAME = "T0" + $TOONUM + "-"
	}
	IF $TOONUM == 0 {
	MESSAGE INFO "YOU FORGOT TO ADD A TOOLNUMBER TO TOOL... $MISSEDTOOLNAME , ADD TOOLNUMBER AND RESTART MACRO!"
	RENAME TOOLPATH ; "NO TOOL NUMBER"
	BREAK
	}
	
	// TOOL DIAMETER VALUES
	STRING TOODIA = ENTITY('tool','').Diameter
	REAL TOOREA = $TOODIA
	REAL TOORND = ROUND ($TOOREA, 4)
	REAL TOOMET = $TOORND / 0.03937
	REAL METRND = ROUND ($TOOMET, 2)
	INT METINT = ROUND ($METRND, 1) 
	// TOOLNAME VARIABLES
	
	
	// STOCK VARIABLES	
	REAL THICC = Toolpath.Thickness
	STRING STOCK = ' '
	
	IF $THICC >= 0.015 {
	$STOCK = "ROUGH"
	}
	IF $THICC < 0.015 AND $THICC >= 0.001 {
	$STOCK = "SEMI"
	}
	IF $THICC < 0.001 {
	$STOCK = "FINISH"
	}
	
	REAL FLTTHICC = Toolpath.AxialThickness
	STRING FLTSTOCK = ' '
	
	IF $FLTTHICC >= 0.015 {
	$FLTSTOCK = "ROUGH"
	}
	IF $FLTTHICC < 0.015 AND $THICC >= 0.001 {
	$FLTSTOCK = "SEMI"
	}
	IF $FLTTHICC < 0.001 {
	$FLTSTOCK = "FINISH"
	}
		
		// NAME STRINGS BUILT FROM VARIABLES
		STRING NEWNAME = $TPNAME + $TOOLNAME
		
		STRING CHAMFERNAME = $NEWNAME + "CHAMFER"
		STRING SCRIBENAME = $NEWNAME + "SCRIBE"
		STRING DRILLNAME = $NEWNAME + $METRND + "MM_DRILL"
		STRING TAPNAME = $NEWNAME + $METINT + "MM_TAP"
		STRING HELINAME = $NEWNAME + $METINT + "MM_HELICAL-" + $STOCK
		STRING RASTERFLAT = $NEWNAME + $METINT + "MM_FLAT-" + $FLTSTOCK
		STRING OFFSETFLAT = $NEWNAME + $METINT + "MM_OFFSETFLAT-" + $FLTSTOCK
				
		// DECIDES WHAT TO NAME THE TOOLPATH BASED ON DIFFERENT TOOLPATH VARIABLES
		
		IF Strategy == "chamfer" {
		$NEWNAME = $CHAMFERNAME
				
		} ELSEIF Tool.Type == "taper_tipped" {
		$NEWNAME = $SCRIBENAME
		
		} ELSEIF Strategy == "drill" {
		IF toolpath.Drill.Type == "helical" {
		$NEWNAME = $HELINAME
			} ELSEIF toolpath.Drill.Type == 'tap_2' {
			$NEWNAME = $TAPNAME
				} ELSE {
				$NEWNAME = $DRILLNAME
				} 
		} ELSEIF Strategy == "raster_flat" {
		$NEWNAME = $RASTERFLAT
		
		} ELSEIF Strategy == "offset_flat" {
		$NEWNAME = $OFFSETFLAT
		
		} ELSEIF $TOOREA == 2.0 {
		$NEWNAME = $NEWNAME + "2_" + $STOCK
				
		} ELSE {
		$NEWNAME = $NEWNAME + $METINT + "MM-" + $STOCK
		}
		RENAME TOOLPATH ; $NEWNAME
}
MESSAGE INFO "TOOLPATHS RENAMED"
Message 67 of 95
kandennti
in reply to: GlennM.MCAM

Hi all.


30.png

I do not change the toolpath thickness when creating the electrode model toolpath I adjust it by adjusting the ThicknessSetValues.

 

Since it takes a lot of time to confirm ThicknessSetValues, I thought about a method to check with a macro.

 

 

 

In order to check as easily as possible, display the tool path name of
'Thickness Preferences' different from the specified tool path (or default) in the InfoBox.

 

31.png

 

 

However, it can not be determined that the [#] part (component) part is
exactly matched because of only numeric comparisons, but that comparison alone is enough for me.

 

 

If you want to compare with any toolpath, 'toolpath.XML' contains

<menupage label="Comparison with this Toolpath" 
	command='MACRO Find_ThicknessSetValues_Unmatched_ToolPath.mac "%s"' />	
</menupage>

If you want to compare with the Defaults

<menupage label="Comparison with Surface Defaults" 
	command='MACRO Find_ThicknessSetValues_Unmatched_ToolPath.mac ""' />	
</menupage>

Development and operation confirmation was done with PMill2018.

 

 

 

Message 68 of 95
jjohnybgood
in reply to: 5axes

Hi

Can this be modified to use in PM2016?

Thank you.

Message 69 of 95
5axes
in reply to: iamcdn79


@iamcdn79  a écrit :

 

Nice work, is there a way to get the draft angle displayed without having to hit F2 again? I would just like to pick a point and display that draft angle value

Finally, I modified my macro according to the request of @iamcdn79 .   You have to modify the time limit to stop the macro if you spend to much time to select the position on your model :

REAL $TLimit = 200  // Time Limit to select a position

 

//
// Measure and display Draft angle Value
// F2 to call the macro
//   -- F2 Each time you want to measure a new angle
// 	
// Version du 25/10/2017
// Version du 12/07/2018  rajout de la version avec 30s pour prendre le temps
//
FUNCTION MAIN() {
	REAL $TLimit = 200  // Time Limit to select a position

	VIEW MODEL ; SHADE UNDERCUT
	ECHO OFF DCPDEBUG UNTRACE COMMAND ACCEPT
	DIALOGS MESSAGE OFF

	MEASURE CLEAR_ALL MODE VECTOR START MEASURE DIRECTION
	MODE DIRECTION ALIGN GEOM
		
	BOOL $F_E=FALSE
	REAL $LIMIT_WHILE=0
        REAL $Timer = 0.25
	
	DO {
		WAIT $Timer
		$F_E=BOOL($widget('DirectionInput.Accept').Sensitive)
		$LIMIT_WHILE=$LIMIT_WHILE+$Timer
		IF $LIMIT_WHILE>$TLimit {
		    DIRECTION CANCEL
			MESSAGE ERROR "Exceeded time for point selection $TLimit : $LIMIT_WHILE"
			MACRO ABORT
		}
	} WHILE NOT $F_E

	// Get the Direction vector
	REAL V_I= REAL($widget('DirectionInput.DirectionFrame.I').value)
	REAL V_J= REAL($widget('DirectionInput.DirectionFrame.J').value)
	REAL V_K= REAL($widget('DirectionInput.DirectionFrame.K').value)

	REAL Calc =0

	IF $V_K == 0 {
		$Calc=90
	} ELSE {
		$Calc=sqrt(($V_I*$V_I)+($V_J*$V_J))
		// PRINT $Calc
		$Calc = Atan($Calc/$V_K)
		IF $Calc > 180 {
			$Calc=$Calc-180
		}
	}
	
	DIRECTION CANCEL
	DIALOGS MESSAGE ON
	STRING $Result = "Draft angle : " + $round($Calc,2)
	MESSAGE INFO $Result
}

 

Sorry works only in release 2017, 2018, 2019  ( function WIDGET available since these releases )

 

Message 70 of 95
Anonymous
in reply to: jjohnybgood


@jjohnybgood wrote:

Hi

Can this be modified to use in PM2016?

Thank you.


Yes )

 

 

//
// Measure and display Draft angle Value
// F2 to call the macro
// 	
FUNCTION MAIN() {
If NOT member($session._keys, "DraftAngle") {
	SESSIONPAR BOOL DraftAngle = 0
} 

	MEASURE CLEAR_ALL MODE VECTOR START MEASURE DIRECTION
	MODE DIRECTION ALIGN GEOM
	
IF $session.DraftAngle==0 { 

	VIEW MODEL ; SHADE UNDERCUT
	$session.DraftAngle=1
} ELSE {

// Get the Direction vector
REAL V_I= 0
REAL V_J= 0
REAL V_K= 0

ECHO OFF DCPDEBUG UNTRACE COMMAND ACCEPT

STRING tmp_file = macro_path(0) + "\_temp.txt"

TRACEFILE OPEN $tmp_file
PRINT FORMVALUE DirectionInput.DirectionFrame.I
PRINT FORMVALUE DirectionInput.DirectionFrame.J
PRINT FORMVALUE DirectionInput.DirectionFrame.K
TRACEFILE CLOSE


// read temp file
FILE OPEN $tmp_file FOR READ AS GetValue
FILE READ $V_I FROM GetValue
FILE READ $V_J FROM GetValue
FILE READ $V_K FROM GetValue
FILE CLOSE GetValue

REAL Calc =0

IF $V_K == 0 {
	$Calc=90
} ELSE {
	$Calc=sqrt(($V_I*$V_I)+($V_J*$V_J))
	// PRINT $Calc
	$Calc = Atan($Calc/$V_K)
    if $Calc > 180 {
		$Calc=$Calc-180
	}
}
STRING $Qry = "Draft angle : " + $round($Calc,3)
BOOL Ret = 0
$Ret = QUERY $Qry

IF $Ret  {
	DIRECTION ACCEPT
	$session.DraftAngle=0
} ELSE {
    // Activate Direction measure mode for next value
	MODE DIRECTION ALIGN GEOM
}

}

 

 

PS: this macro was adopted for PowerMILL 2016 by user impact  from other PM forum.

Message 71 of 95
johnc4668
in reply to: 5axes

@5axes this macro is awesome!  Any way to get it to read for example 7.34 deg instead of 82.66 deg? 

Message 72 of 95
5axes
in reply to: johnc4668

@johnc4668

$Calc=90-$Calc
STRING $Result = "Draft angle : " + $round($Calc,2)
Message 73 of 95
johnc4668
in reply to: 5axes

@5axes heres my macro mod. Im still getting the same result (pardon my macro knowledge!)

 

2018-08-17_13-51-00.jpg

Message 74 of 95
iamcdn79
in reply to: johnc4668

Try this

//
// Measure and display Draft angle Value
// F2 to call the macro
//   -- F2 Each time you want to measure a new angle
// 	
// Version du 25/10/2017
// Version du 12/07/2018  rajout de la version avec 30s pour prendre le temps
//
FUNCTION MAIN() {
	REAL $TLimit = 200  // Time Limit to select a position

	VIEW MODEL ; SHADE UNDERCUT
	ECHO OFF DCPDEBUG UNTRACE COMMAND ACCEPT
	DIALOGS MESSAGE OFF

	MEASURE CLEAR_ALL MODE VECTOR START MEASURE DIRECTION
	MODE DIRECTION ALIGN GEOM
		
	BOOL $F_E=FALSE
	REAL $LIMIT_WHILE=0
        REAL $Timer = 0.25
	
	DO {
		WAIT $Timer
		$F_E=BOOL($widget('DirectionInput.Accept').Sensitive)
		$LIMIT_WHILE=$LIMIT_WHILE+$Timer
		IF $LIMIT_WHILE>$TLimit {
		    DIRECTION CANCEL
			MESSAGE ERROR "Exceeded time for point selection $TLimit : $LIMIT_WHILE"
			MACRO ABORT
		}
	} WHILE NOT $F_E

	// Get the Direction vector
	REAL V_I= REAL($widget('DirectionInput.DirectionFrame.I').value)
	REAL V_J= REAL($widget('DirectionInput.DirectionFrame.J').value)
	REAL V_K= REAL($widget('DirectionInput.DirectionFrame.K').value)

	REAL Calc =0

	IF $V_K == 0 {
		$Calc=0
	} ELSE {
		$Calc=sqrt(($V_I*$V_I)+($V_J*$V_J))
		// PRINT $Calc
		$Calc = Atan($Calc/$V_K)
		IF $Calc > -180 {
			$Calc=90-$Calc
		}
	}
	
	DIRECTION CANCEL
	DIALOGS MESSAGE ON
	STRING $Result = "Draft angle : " + $round($Calc,2)
	MESSAGE INFO $Result
}

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

Message 75 of 95
johnc4668
in reply to: iamcdn79

@iamcdn79 nailed it, thanks! I changed the shade to rainbow and its easier to rotate cad on my computer. Draft shading is jerky with rotating the part. Thanks again, cheers! 

Message 76 of 95
danmic7JH66
in reply to: johnc4668

Playing around with Infoboxes recently I made a macro that lists all selected toolpaths and some parameters for a quick reference and checking over our work. Works like a charm and figured I'd share it here. She gets the job done and makes sure I don't have to flip through a bunch of pages. I dig it, figured others may as well.

// JOB NUMBER AND DETAIL NUMBER VARIABLES
FOREACH $pal IN folder('model') {

if position ($pal.name,"CAM") >= 0 {
 
FOREACH $mod IN folder('model') {
  STRING Lname = lcase($mod.name)
  if position ($lname,"cam") >= 0 {
 
    STRING path = pathname(mod)
    STRING base = basename(path)

// MACHINE TOOL VARIABLES
DIALOGS MESSAGE OFF
ACTIVATE MachineTool "Mazak VCU400a"
ACTIVATE MachineTool "Okuma_GENOS_M560_V_No_Guarding"
DIALOGS MESSAGE ON
STRING MACHNAME = ENTITY('machinetool','').name

// INFOBOX TITLE VARIABLES

STRING LIST PARTS = tokens(lname, '-')	
STRING JOBNUMBER = UCASE ($PARTS[0])
STRING DETAILNUMBER = UCASE ($PARTS[1])
STRING SESS = UCASE ($PARTS[3])
STRING PROJECTPATH = "S:\aba-agf\" + $JOBNUMBER + "\Session Files\" + $SESS + "\" + $JOBNUMBER + "-" + $DETAILNUMBER + "-" + $SESS + "\ncprograms\"	
STRING INFOTITLE = $JOBNUMBER + "-" + $DETAILNUMBER + " TOOLPATH INFO"

// COLOUR VARIABLES

INT LIST RED = {255,0,0}
INT LIST BLACK = {0,0,0}
INT LIST GREEN = {0,255,0}
INT LIST BLUE = {0,0,255}

// TOTAL SIMULATION TIME OF SELECTED TOOLPATHS
REAL SIMTOTE = 0

// BUILDS BASE INFOBOX AND ADDS FILE PATH TO IT

INFOBOX CLEAR FORMAT
INFOBOX STATE "auto_newline" TRUE
INFOBOX NEW $INFOTITLE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $RED
INFOBOX APPEND "MACHINE: " 
INFOBOX STATE "underline" FALSE
INFOBOX STATE "text_colour" $BLACK
INFOBOX APPEND $MACHNAME

 FOREACH $Selected_Toolpath IN (explorer_selected_entities()) {
    // Exit if the selected entities are not Toolpaths
    IF $Selected_Toolpath.RootType != "toolpath" {
        BREAK
  }
    MACRO APPERROR CONTINUE
ACTIVATE TOOLPATH $Selected_Toolpath

// STRING VARIABLES

STRING TPNAME = ENTITY('toolpath','').name
STRING TOOLNAME = ENTITY('tool','').name
STRING STRAT = UCASE (ENTITY('toolpath','').STRATEGY)
STRING TPEDITS = ENTITY('toolpath','').History.Modified 
STRING LDSIN1 = $TOOLPATH.Connections.LeadIn[0].Type
STRING LDSIN2 = $TOOLPATH.Connections.LeadIn[1].Type
STRING LDSOUT1 = $TOOLPATH.Connections.LeadOut[0].Type
STRING LDSOUT2 = $TOOLPATH.Connections.LeadOut[1].Type
STRING LNKS = $Toolpath.Connections.Link[0].Type
STRING LNKS2 = $Toolpath.Connections.Link[1].Type
STRING LNKS3 = $Toolpath.Connections.Link[3].Type
STRING TOONUM = ENTITY('toolpath','').tool.number
STRING TOL = ENTITY('toolpath','').TOLERANCE

// REAL VARIABLES 

REAL FR = ROUND ($TOOLPATH.FEEDRATE.CUTTING.VALUE, 1)
STRING FRINF = $FR
REAL RPM = ROUND ($TOOLPATH.SPINDLESPEED.VALUE, 1)
STRING RPMINF = $RPM
REAL THICC = Toolpath.Thickness
REAL FLTTHICC = Toolpath.AxialThickness
REAL SIMIND = $TOOLPATH.Statistics.TotalTime
REAL SIMRND = ROUND ($SIMIND, 2)
$SIMTOTE = $SIMTOTE + $SIMRND








STRING THICCINF = ''
STRING THICCINFAXI = ''
STRING SIMRNDINF = $SIMRND + " MINUTES"
STRING LDSININFSND = ''
STRING LDSOUTINFSND = ''

IF $toolpath.UseAxialThickness == 1 {
$THICCINF = $THICC
$THICCINFAXI = $FLTTHICC
} ELSE {
$THICCINF = $THICC
}



// TOOLPATH NAME
INFOBOX APPEND ""
INFOBOX STATE "auto_newline" TRUE
INFOBOX STATE "text_colour" $RED
INFOBOX STATE "underline" TRUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND $TPNAME

// STRATEGY
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "STRATEGY:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $STRAT
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// TOLERANCE
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOLERANCE:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $TOL
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// TOOL
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOOL:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $TOOLNAME
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// TOOL NUMBER
IF $TOONUM == "0" {
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOOL NUMBER:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND "NO TOOL # ASSIGNED"
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

	} ELSE {
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "TOOL NUMBER:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $TOONUM
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
}
// RPM
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "RPM:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $RPMINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

//FEED
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "FEEDRATE:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $FRINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// POINT DISTRIBUTION
IF $TOOLPATH.MaxDistanceBetweenPoints.Active == 1 {
REAL PNTS = ROUND ($TOOLPATH.MaxDistanceBetweenPoints.VALUE, 4)
STRING PNTSINF = $PNTS
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "MAX DISTANCE BETWEEN POINTS:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $PNTSINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""
} ELSE { 
}

// THICKNESS
IF $toolpath.UseAxialThickness == 1 {
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "THICKNESS:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $THICCINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "AXIAL THICKNESS:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $THICCINFAXI
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

	} ELSE {
	
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "THICKNESS:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $THICCINF
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
	}

// LEADS IN 
IF $TOOLPATH.Connections.LeadIn[1].Type == "none" {
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "LEADS IN:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $LDSIN1
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

	} ELSE { 
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "LEAD IN:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $LDSIN1
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
	
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "LEAD IN 2ND CHOICE:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $LDSIN2
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
}

// LEADS OUT 
IF $TOOLPATH.Connections.LeadOut[1].Type == "none" {
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "LEAD OUT:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $LDSOUT1
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

	} ELSE { 
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "LEAD OUT:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $LDSOUT1
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
	
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "LEAD OUT 2ND CHOICE:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $LDSOUT2
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
	}

// LINKS FIRST
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "LINKS 1ST CHOICE:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $LNKS
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// LINKS SECOND
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "LINKS 2ND CHOICE:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $LNKS2
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// SIMULATION TIME
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOOLPATH SIMULATION TIME:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $SIMRNDINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND " "
}

// CONVERTS SIM TOTE TO STRING
REAL SIMHRS = $SIMTOTE / 60
REAL SIMRND = ROUND ($SIMHRS, 2)
STRING SIMTOTEINF = $SIMRND + " HRS"

// ADDS TOTAL SIMULATION TIME
INFOBOX APPEND ""
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $GREEN
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOTAL SIMULATION TIME OF SELECTED TOOLPATHS:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $SIMTOTEINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""
}
}
}
}
DEACTIVATE MACHINETOOL 
Message 77 of 95
Ye。xg
in reply to: danmic7JH66

I used PowerMill Ultimate 2019 to run it, but it didn't work.

Message 78 of 95
danmic7JH66
in reply to: Ye。xg


@Ye。xg wrote:

I used PowerMill Ultimate 2019 to run it, but it didn't work.


Sorry about that, I had some custom variables in there that only work with our model names and file structure. I reworked it a bit for you, this should do the trick. Try this and let me know how it works and if you like it!

// COLOUR VARIABLES

INT LIST RED = {255,0,0}
INT LIST BLACK = {0,0,0}
INT LIST GREEN = {0,255,0}
INT LIST BLUE = {0,0,255}

// TOTAL SIMULATION TIME OF SELECTED TOOLPATHS
REAL SIMTOTE = 0

// BUILDS BASE INFOBOX AND ADDS FILE PATH TO IT

INFOBOX CLEAR FORMAT
INFOBOX STATE "auto_newline" TRUE
INFOBOX NEW "Programs"
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $RED
INFOBOX APPEND "MACHINE: " 
INFOBOX STATE "underline" FALSE
INFOBOX STATE "text_colour" $BLACK

 FOREACH $Selected_Toolpath IN (explorer_selected_entities()) {
    // Exit if the selected entities are not Toolpaths
    IF $Selected_Toolpath.RootType != "toolpath" {
        BREAK
  }
    MACRO APPERROR CONTINUE
ACTIVATE TOOLPATH $Selected_Toolpath

// STRING VARIABLES

STRING TPNAME = ENTITY('toolpath','').name
STRING TOOLNAME = ENTITY('tool','').name
STRING STRAT = UCASE (ENTITY('toolpath','').STRATEGY)
STRING TPEDITS = ENTITY('toolpath','').History.Modified 
STRING LDSIN1 = $TOOLPATH.Connections.LeadIn[0].Type
STRING LDSIN2 = $TOOLPATH.Connections.LeadIn[1].Type
STRING LDSOUT1 = $TOOLPATH.Connections.LeadOut[0].Type
STRING LDSOUT2 = $TOOLPATH.Connections.LeadOut[1].Type
STRING LNKS = $Toolpath.Connections.Link[0].Type
STRING LNKS2 = $Toolpath.Connections.Link[1].Type
STRING LNKS3 = $Toolpath.Connections.Link[3].Type
STRING TOONUM = ENTITY('toolpath','').tool.number
STRING TOL = ENTITY('toolpath','').TOLERANCE

// REAL VARIABLES 

REAL FR = ROUND ($TOOLPATH.FEEDRATE.CUTTING.VALUE, 1)
STRING FRINF = $FR
REAL RPM = ROUND ($TOOLPATH.SPINDLESPEED.VALUE, 1)
STRING RPMINF = $RPM
REAL THICC = Toolpath.Thickness
REAL FLTTHICC = Toolpath.AxialThickness
REAL SIMIND = $TOOLPATH.Statistics.TotalTime
REAL SIMRND = ROUND ($SIMIND, 2)
$SIMTOTE = $SIMTOTE + $SIMRND








STRING THICCINF = ''
STRING THICCINFAXI = ''
STRING SIMRNDINF = $SIMRND + " MINUTES"
STRING LDSININFSND = ''
STRING LDSOUTINFSND = ''

IF $toolpath.UseAxialThickness == 1 {
$THICCINF = $THICC
$THICCINFAXI = $FLTTHICC
} ELSE {
$THICCINF = $THICC
}



// TOOLPATH NAME
INFOBOX APPEND ""
INFOBOX STATE "auto_newline" TRUE
INFOBOX STATE "text_colour" $RED
INFOBOX STATE "underline" TRUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND $TPNAME

// STRATEGY
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "STRATEGY:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $STRAT
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// TOLERANCE
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOLERANCE:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $TOL
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// TOOL
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOOL:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $TOOLNAME
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// TOOL NUMBER
IF $TOONUM == "0" {
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOOL NUMBER:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND "NO TOOL # ASSIGNED"
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

	} ELSE {
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "TOOL NUMBER:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $TOONUM
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
}
// RPM
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "RPM:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $RPMINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

//FEED
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "FEEDRATE:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $FRINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// POINT DISTRIBUTION
IF $TOOLPATH.MaxDistanceBetweenPoints.Active == 1 {
REAL PNTS = ROUND ($TOOLPATH.MaxDistanceBetweenPoints.VALUE, 4)
STRING PNTSINF = $PNTS
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "MAX DISTANCE BETWEEN POINTS:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $PNTSINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""
} ELSE { 
}

// THICKNESS
IF $toolpath.UseAxialThickness == 1 {
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "THICKNESS:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $THICCINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "AXIAL THICKNESS:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $THICCINFAXI
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

	} ELSE {
	
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "THICKNESS:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $THICCINF
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
	}

// LEADS IN 
IF $TOOLPATH.Connections.LeadIn[1].Type == "none" {
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "LEADS IN:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $LDSIN1
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

	} ELSE { 
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "LEAD IN:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $LDSIN1
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
	
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "LEAD IN 2ND CHOICE:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $LDSIN2
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
}

// LEADS OUT 
IF $TOOLPATH.Connections.LeadOut[1].Type == "none" {
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "LEAD OUT:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $LDSOUT1
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

	} ELSE { 
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "LEAD OUT:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $LDSOUT1
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
	
	INFOBOX STATE "auto_newline" FALSE
	INFOBOX STATE "underline" TRUE
	INFOBOX STATE "text_colour" $BLUE
	INFOBOX STATE "bold" TRUE
	INFOBOX APPEND "LEAD OUT 2ND CHOICE:"
	INFOBOX STATE "text_colour" $BLACK
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "bold" FALSE
	INFOBOX APPEND " "
	INFOBOX APPEND $LDSOUT2
	INFOBOX STATE "auto_newline" TRUE
	INFOBOX APPEND ""
	}

// LINKS FIRST
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "LINKS 1ST CHOICE:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $LNKS
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// LINKS SECOND
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "LINKS 2ND CHOICE:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $LNKS2
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""

// SIMULATION TIME
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $BLUE
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOOLPATH SIMULATION TIME:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $SIMRNDINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND " "
}

// CONVERTS SIM TOTE TO STRING
REAL SIMHRS = $SIMTOTE / 60
REAL SIMRND = ROUND ($SIMHRS, 2)
STRING SIMTOTEINF = $SIMRND + " HRS"

// ADDS TOTAL SIMULATION TIME
INFOBOX APPEND ""
INFOBOX STATE "auto_newline" FALSE
INFOBOX STATE "underline" TRUE
INFOBOX STATE "text_colour" $GREEN
INFOBOX STATE "bold" TRUE
INFOBOX APPEND "TOTAL SIMULATION TIME OF SELECTED TOOLPATHS:"
INFOBOX STATE "text_colour" $BLACK
INFOBOX STATE "underline" FALSE
INFOBOX STATE "bold" FALSE
INFOBOX APPEND " "
INFOBOX APPEND $SIMTOTEINF
INFOBOX STATE "auto_newline" TRUE
INFOBOX APPEND ""
Message 79 of 95
Ye。xg
in reply to: danmic7JH66

Thank you very much for your reply. Now it works very well. Thanks again.

Message 80 of 95
jjohnybgood
in reply to: danmic7JH66

Hi danmic7JH66,

Can this be changed to also work from active NC Programme? ie where you have a number of toolpaths in the NC Programme then use macro to display details?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report