Skip to content

Python API

Scripting interface for Sim4Life

143 Topics 446 Posts
  • how to set the weights of field combiner in python?

    Moved Solved
    4
    1 Votes
    4 Posts
    2k Views
    SylvainS
    sorry, I gave you some code for the Simulation Combiner, not the Field Combiner... This is how you can use the GetWeights and SetWeights functions for the field combiner: >>> field_combiner.GetWeights() ((1+0j), (1+0j)) >>> field_combiner.SetWeights( ( (2+0j), (-3+0j) ) )
  • How to clear the Console via Python?

    Moved python
    1
    1 Votes
    1 Posts
    593 Views
    No one has replied
  • How to create a Cone from Python?

    Moved python
    2
    0 Votes
    2 Posts
    1k Views
    SylvainS
    There is no python interface for the Solid Cone creation tool. However, you can achieve the same result by using the SkinWires() primitive as follows: import s4l_v1.model as model import XCoreModeling c1 = model.CreateCircle(model.Vec3(0,0,0), model.Vec3(0,0,1), 50) c2 = model.CreateCircle(model.Vec3(0,0,50), model.Vec3(0,0,1), 25) XCoreModeling.SkinWires([c1, c2])