Prompted macro for selecting boundaries

jjat-wang
Advocate

Prompted macro for selecting boundaries

jjat-wang
Advocate
Advocate

I want to pop up the form when I create a new toolpath to prompt me to select the boundary.

Like this

 

捕获.PNG

0 Likes
Reply
Accepted solutions (2)
1,187 Views
11 Replies
Replies (11)

LasseFred
Collaborator
Collaborator
Accepted solution

You can not do that.

but if you want, you can make a macro for each strategy.

 

IMPORT TEMPLATE ENTITY TOOLPATH TMPLTSELECTOR "Finishing/Constant-Z-Finishing.002.ptf"
$TOOLPATH_BOUNDARY = INPUT ENTITY BOUNDARY "CHOOSE A BUNDARY"
ACTIVATE BOUNDARY $TOOLPATH_BOUNDARY
______________________
Lasse F.

jjat-wang
Advocate
Advocate

thank you . This is what I am looking for.

ENTITY $TOOLPATH_BOUNDARY = INPUT ENTITY BOUNDARY "CHOOSE A BUNDARY"

 

0 Likes

jjat-wang
Advocate
Advocate

If it's StockModel, how do you put it in the table?

捕获.PNG

0 Likes

LasseFred
Collaborator
Collaborator

$STOCKMODEL = INPUT ENTITY STOCKMODEL "CHOOSE STOCKMODEL"

______________________
Lasse F.
0 Likes

jjat-wang
Advocate
Advocate

I know the command to select the window, but I will not put parameters in it.

[EDIT PAR 'StockModelState.StockModel' $STOCKMODEL ]   Unable to work

捕获.PNG  

0 Likes

LasseFred
Collaborator
Collaborator

You cant have a variable like that.

 

Try:

$STOCKMODEL = INPUT ENTITY STOCKMODEL "CHOOSE STOCKMODEL"
STRING $STOCKM = EDIT PAR 'StockModelState.StockModel' + $STOCKMODEL
DOCOMMAND $STOCKM
______________________
Lasse F.
0 Likes

jjat-wang
Advocate
Advocate

ERROR

捕获.PNG捕获2.PNG

0 Likes

LasseFred
Collaborator
Collaborator
Accepted solution

Try this:

 

STRING $STOCKMODEL_NAME = ""
$STOCKMODEL_NAME = INPUT ENTITY STOCKMODEL "Select STOCKMODEL"

STRING $STOCK1 = "EDIT PAR 'StockModelState.StockModel' "
STRING $STOCK2 = $STOCKMODEL_NAME
STRING $STOCK4 = $STOCK1 + "'"+$STOCK2+"'"

DOCOMMAND $STOCK4
______________________
Lasse F.
0 Likes

urizenYHS3W
Advocate
Advocate
$StockModelState.StockModel = $StockModel_Name
0 Likes

jjat-wang
Advocate
Advocate

thank it's working

0 Likes

richard.pedley
Autodesk
Autodesk

I recently wrote a plugin for PowerMill that will allow you to fire macros in response to events happening in PowerMill, for example when a toolpath is created. You will need to use the EntityCreated event and filter it to Entity Type: Toolpath.

It has been tested although not thoroughly and it does have the potential to slow down PowerMill if you use complex macros in it, however for simple applications such as the one you are looking for it should work well.

I've tried to make it intuitive to use so there is no documentation for it but reply to this message if you need some help, or encounter an issue.

I have uploaded the source code as well so if you are familiar with C# you can make changes yourself.

https://myshare.autodesk.com/:f:/g/personal/richard_pedley_autodesk_com/Ek2uWSemZ-lOrBlhTOnQec0B_XOf...

Link is only valid until 23/9/2018.

 

Hope that helps

 

Richard

 



Richard Pedley
Research Engineer