So if I define a new property in the post property table and add "operation" to the scope:
If I change the value in an operation dialog, when posted from F360, it then passes the following (taken from a dump file):
What is the proper syntax to access this property passed in from the post process tab of the operation dialog?
I have tried:
currentSection.getProperty("operation_post_property:testProperty1") <<<returns undefined
currentSection.getProperty("testProperty1") <<<returns the "global" post value of 0
getProperty("operation_post_property:testProperty1") <<<returns undefined
getProperty("testProperty1") <<<returns the "global" post value of 0
I either get the "default" value and not the changed value with the getProperty methods or an undefined as a value.
When I try various getParameter variations or trying to catch it in the OnParameter section, I have only managed to make the post fail or see no results.
Any help or direction would be greatly appreciated.
Ken
You may have to parse the id values of the object array:
if (getProperty("testProperty1") == "1") {
... some code
}
Also just a friendly suggestion consider changing the title to something more searchable, i.e., "How to access a user defined property"
Hi @ktorokU233T
There are two methods to get the property value the correct syntaxes are
getProperty(property [,default-value])
section.getProperty(property [,default-value])
You can find more details post processor training guide - Accessing properties
And if a property is defined as a post and an operation property, then the setting made in the NC Program dialogs will be ignored by the post processor, only the setting made in each separate operation will be used by the post processor. The only place you would be able to query the Post Process property setting is in onOpen when using the getProperty function.
you can get more info in the post processor training guide - properties scope
So in that case if you are calling getProperty in onOpen section it will always return the property value set in the nc program dialog.
Thank you both @componentscience and @boopathi.sivakumar for your answers.
After a few hours of swearing and beating my head on the desk, a few more cups of coffee, and dozens of lines of debug only code, it all came back to operator error and an overlooked mismatched machine definition to post processor. Once that was straightened out, all worked as expected. I gotta stop trying to update more then 1 post at a time.
Ken
Can't find what you're looking for? Ask the community or share your knowledge.