Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Post processor and pyton script

0 REPLIES 0
Reply
Message 1 of 1
CAM_exeger
329 Views, 0 Replies

Post processor and pyton script

We run the post processing from Fusion 360 by means of a Python script. In this script we set post program properties with a pairs of name and value (see snippet below). When the name of such a property in the Python script matches a user-defined property in the post program, i.e. in the Javascript file (.cps), the program receives the value provided by the Python script. This is good and as expected.

 

Question: Is it in the Python script possible to read (etc) which user-defined properties in the Post program that are available? In terms of the script snippet below, one would expect something like postInput.<whatever ...> ?

 

In the Python (.py) script we set post properties, in the case below it is just one property named “testProperty

Script.JPG

 

In the Javascript (.cps) file we define our user-defined properties, in the case below it is just one property named “testProperty”.

 

// User-defined properties

properties = {

  testProperty: {

       title: "Test of a user defined property",

       description: "Output the machine settings in the header of the code.",

       group: "MyTest",

       type: "string",

       value: "piglet",

       scope: "post",

       enabled: "milling"

  }

}

...

 

  v0 = getProperty("testProperty", "No value provided");

 

  if (v0) {

    writeln("  getProperty(testProperty)=" + toString(v0));

}

else {

    writeln("  No property found by getProperty(testProperty)");

}

0 REPLIES 0

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report