Photonics

Photonics

groupscope not working in setup script

    • hany
      Subscriber

      Does anyone know if there is a way to delete all the elements inside a structure group within the setup script?

      I tried to use the groupscope command in the setup script of the model but it gives the error message:

    • ChrisLee
      Subscriber

      Maybe because you're edit in analysis group while "groupscope" can't used in here,you can just try "selectall;delect;" 

      "groupscope" can be used in Script File Editor.

      • hany
        Subscriber

        That will delete all the structures under the model. The idea here is to only delete the elements inside a group structure using the script inside the "::model".  

        • ChrisLee
          Subscriber

          Maybe selectpartial,shiftselect,or shiftselectpartial will work for you,you can have a try.

        • ChrisLee
          Subscriber

          deleteall;

          for(i=1:3){

          addrect;

          set('name','rectangle'+num2str(i));

          }

          selectpartial('rectangle');

          addtogroup('rec');

           

          for(i=1:3){

          addcircle;

          set('name','circle'+num2str(i));

          }

          selectpartial('circle');

          addtogroup('cir');

           

          #1 for all the elements have the partial name "circle" in the same group;

          selectpartial("cir::circle");

          delete;

           

          #2 select element one by one;

          unselectall;

          shiftselect("rec::rectangle1");

          shiftselect("rec::rectangle2");

          shiftselect("rec::rectangle3");

          delete;

Viewing 1 reply thread
  • You must be logged in to reply to this topic.