Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. Python API
  4. Is there an equivalent of "Remove Parametrization" from the Python API?

Is there an equivalent of "Remove Parametrization" from the Python API?

Scheduled Pinned Locked Moved Solved Python API
pythonmodeling
3 Posts 2 Posters 549 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SylvainS Offline
    SylvainS Offline
    Sylvain
    ZMT
    wrote on last edited by
    #1

    I would like to unite a coil (created using the Template Tool) with a polyline (to close the circuit).
    The Boolean operations are not available, however, since the coil objects are locked. Removing the parametrization of the coil works in the GUI but how to do it from Python?

    0_1510649859862_cfb6d009-6d90-4eb1-b933-183692252409-image.png

    1 Reply Last reply
    0
    • PeterStijnmanP Offline
      PeterStijnmanP Offline
      PeterStijnman
      wrote on last edited by
      #2

      No clue if you still need the answer to this, but a solution is:

      import s4l_v1.model as model
      
      entities = model.AllEntities()
      
      # select the group of coils
      Coil_Group = entities['COIL 1']
      
      # get the entities of in the group
      Coils = Coil_Group.Entities
      
      # loop over the entities and set the remove only to false
      # this should be enough to use boolean operations
      for Coil in Coils:
      	Coil.ReadOnly = False
      
      # if you also want to remove the parameters from the coil group
      Coil_Group.Parameters.Clear()
      

      Cheers ^^

      1 Reply Last reply
      0
      • SylvainS Offline
        SylvainS Offline
        Sylvain
        ZMT
        wrote on last edited by
        #3

        Brilliant, thanks!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Search