12-06-2021, 04:29 PM (This post was last modified: 12-06-2021, 05:14 PM by ANDY_F1.)
When running a program through a post processor, how do I determine the name of the current target within the MoveJ section of the post processor?
I'm using the joints to add a joint command but want to change a parameter based on the name of the target within RDK
Oddly this doesn't work for joint moves where I've used the 'setInstruction' method in the C# API and modified a joint move - I set the desired name correctly and it shows in the tree in RDK.
It appears to output the target name when I use AddTarget and create a MoveJ through the API, but not the setInstruction modification method.
I can see that it outputs the target name ahead of the call to the joint values in %temp% middle file - how do I grab that name in the post processor?
target_name = None
if hasattr(self, '_TargetName'):
# Check if the setting was enabled in robodk
if self._TargetName is None:
pass # This means the target has no name
if type(self._TargetName) is list:
target_name = self._TargetName[position].replace(' ','_')
target_name = self._TargetName.replace(' ','_')
I'm not aware of the specific related to this programming method, but this is what I've been told to do in the post where I needed it and it worked, so... XD.
So if you modify an instruction through the API using setinstruction, and call it a joint move, passing through a name, it won't name it properly with a property that works for exporting to the PP, it only works through the API if you call AddMoveJ, seems to set the properties correctly.. would be good if this could be fixed...