Forum Replies Created
Thank you guys, that was really helpful.
I edited the program as follows:Python1234567891011121314151617181920from vcScript import *comp = getComponent()#get property to set its valuepoint = comp.getProperty("GLOBAL::Job1_PickUp")#I taught robot a position, and now using that position#another option is to use the readIn() method in vcMotionStatementrx = comp.getBehaviour("Executor")statement = rx.Program.MainRoutine.Statementss_point = statement.Positions.PositionInWorld#value is now stored in propertypoint.Value = s_pointnew_statement = rx.Program.MainRoutine.addStatement(VC_STATEMENT_LINMOTION)new_statement.Positions.PositionInWorld = point.Valueprop = new_statement.createProperty(VC_STRING, "GLOBAL::PosName")prop.Value = "Job1_PickUp"
Now I can add a VC_STRING type property to new_statement. Even though statement names are different, under global section, I can set the name of this PosName variable as I want.
As you guys also mentioned nex step would be following:
In Job Map section , If I select a position with GLOBAL::PosName property and click on touch up button or change value of it manually, I should update all positions in robot program with the same GLOBAL::PosName property.
I think that could be possible. What kind of event handler should I use in this case?
Thank you in advance…1+
Thanks for quick reply. An example of creating KRL statements using PYTHON API would be really helpful.
But No, I don’t mean HOME positions. HOME positions are defined as properties in KUKA SimPro and have joint values not cartesian coordinates.
In our Robot programs we usually use global positions for certain things. Because these positions are used in different movement programs in different scenarios.
So let’s say I want to define a position as global and want to use this position in different programs(as I can do with HOME positions in VC). When I change the global position somewhere in the robot Program, It should be updated everywhere in the robot.
Visual Components does not allow same Position name to exist more than one as statement. That is the main problem I have now. So i can just not use addStatemen() function in a routine and set the name.
I am now trying to add new positions into Robot Properties like default HOME positions(but in cartesian coordinates not joint values) and be able to add these positions everywhere in the sub programs as we can do with HOME positions. Any help would be amazing here.0