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: 

Get all the user defined setting names and values?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
hx
Advocate
244 Views, 4 Replies

Get all the user defined setting names and values?

project.keys.png

 

As the image show. How can I get all the user define names and values.

4 REPLIES 4
Message 2 of 5
icse
in reply to: hx

hope this helps:

 

 

 

entity $tp = entity('toolpath','')

string $op = ''
foreach $key in $tp.UserParameters._keys {
	$op = $op + $key + ': ' + $tp.UserParameters[$key] + CRLF
}

message info $op

 

 

this should give you the keys and values in separate lists:

 

string list $keys = entity('toolpath','').UserParameters._keys

string list $values = apply($keys, 'entity("toolpath";"").UserParameters[this]')

 

 

and this should give you a map with key/value pairs:

object $kv = entity('toolpath','').Userparameters
Message 3 of 5
hx
Advocate
in reply to: icse

I am sorry, the problem description was not cleared. The user-defined parameter here is the user-defined parameter for the specified project

 

002.png

Message 4 of 5
icse
in reply to: hx

thats a bit tricky

 

this gives you the parameter keys but i think there are some 'hidden' key value pairs not shown in the list:

project._keys

i take a closer look on this later

Message 5 of 5
icse
in reply to: hx

try this:

//removes the project parameters set by powermill
string list $userPars = subtract(project._keys, {"Programmer","Customer","TextBlocks","HoleTagCatalog","FusionProductionJob","A360","ThicknessSets","PartName","ProjectHistory","Tolerances","OrderNumber","Notes"})

string $op = ''

foreach $k in $userPars {
		$op = $op + $k + ': ' + project[$k] + CRLF
}

message info $op

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report