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

Can't find documentation (new macro commands)

Message 1 of 5
490 Views, 4 Replies

Can't find documentation (new macro commands)

Hello  to all,


I found here a lot of very inspiring macros, written by some real programming idols. Many thanks to all for sharing this great work!  But unfortunately the customizing for my own circumstances causes often a lot of "try and error", because I can not find any explanation in the "Macro programming guide".


Two examples:

FOREACH $Selected IN (explorer_selected_entities()) ....

string list tp_names = extract(flatten(extract($progs, 'nctoolpath')), 'name')


How are the possibilities with "explorer_selected_entities", how is it to use and what the hell means "flatten" inside of the extract-command?


Is there any further documentation for macro commands which are not descripted in the here downloadeble guide?

Tags (1)
Labels (1)
Message 2 of 5
in reply to: old_snickers

The definitions youre looking for are under help, documentation, parameters, reference. In that document you can go to the Functions section and find examples and definitions of your two examples as well as a host of others.



the numbers never lie
Message 3 of 5
in reply to: old_snickers

So near yet so far....



Many. many thanks!

Message 4 of 5
in reply to: old_snickers

Taken the example given with flatten above, if you do something like
    extract(folder('toolpath'),' Name')
what you get back is a list of toolpath names. So you can do something like

STRING LIST names = extract(folder('toolpath'), 'Name')

but what happens if you


what you get back is a list where each item in the list is a list of names. In effect you have a list of lists. Now you could write something like

STRING LIST badsurfs = {}
FOREACH lst IN extract(folder('toolpath','BadSurfaces.List') {
  FOREACH item IN lst {
    int x = add_last(badsurfs, item)


the flatten() function takes a list of lists and puts the contents of all the lists into a single list. in effect it 'flattens' the list of list.


Message 5 of 5
in reply to: old_snickers

Sounds reasonable... I will do some experiments with this (and with a little more plan now) 😉

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

Post to forums  

Technology Administrators

Autodesk Design & Make Report