I have made a custom folder in eCat under ‘My Models’ with template models of the track segment components I modelled. My aim is to generate an automated track from these models using add-on files (init.pyfile andCommandfile) and instead of xml file i am using a JSON config file with segment details but no x,y,z positions. Placement is done using the segment lengths and zero position values of each segments in the config file and connection using interfaces.
The segments are being generated but their placement in the world is not correct or being correctly translated, its like they have a pose lock. Can anyone give me a hint or insights on how to tackle this problem or point out any mistakes in my approach?
Hello, Could you maybe provide the Code you are using to set the position of the segments. It’s hard to problemshoot the issue without this. Also make sure to update the simulation after changing the PositionMatrix of a Component otherwise the changes won’t be visible. To do this you can use the following Code:
Currently I have only tried with app.render() as my understanding was the changes in script will get updated when I close and reopen the script. I am generating the track into an empty world.
Note that nm.P.X = 10.0 doesn’t work. That’s beacuse nm.P creates a new vcVector instance with the position value but it’s not tied to nm after its creation. So this sets the X of that copy while original matrix position remains the same. So try: P = nm.P P.X = 10.0 nm.P = P
This is quite common mistake and something to user needs to get used to in VC API.