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
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)");
}
Can't find what you're looking for? Ask the community or share your knowledge.