Hi all,
I'm trying to make some new frames within a program however it seems to be creating them all relative to the flange/tcp - which could be different each startup. Is there a way to create new frames whilst using world Cartesian transformation?
Here is an example of the code:
The frames will all have names of integers and this is in a loop to create multiple frames.
To ensure it creates frames relative to the program being run I make sure to delete old frames before creating new ones.
ToolchangerOrigin is a private var within the program that stores an arbitary point within it
Code
ObjectFrame tempName = this.toolChangerOrigin.getChild(Integer.toString(i+1));
if (tempName != null) {
if (tempName.getChild("safeZ") != null) {
tempName.getOwner().removeFrame(tempName.getChild("safeZ"));
tempName.getOwner().removeFrame(tempName.getChild("safeY"));
}
World.Current.removeFrame(tempName);
}
Frame tempFrame = new Frame(this.toolChangerOrigin, mmToTCP1inX + i*mmDistanceBetweenTCP, mmToTCP1inY, mmToTCP1inZ);
ObjectFrame tempObjFrame = World.Current.addChildFrame(Integer.toString(i+1), this.toolChangerOrigin, tempFrame.getTransformationFromParent());
this.toolFrames.add(tempObjFrame);
Display More