4 Replies Latest reply on Jul 28, 2015 9:32 PM by Jason King

    set_CustomInfo didn't work

    Jason King

      Hello,all,I got a question here,please help me.Here's my question.

      There's a combobox in my custom property.It's name is combobox.It looks like this in my custom property edit page.


      At first,the combobox's value is empty.After I used code to change it,it's value change to com1,the code works.The code is:

      swDoc.set_CustomInfo("combobox", "com1");

      The page looks like this:


      Ater this,I used this code:

      swDoc.set_CustomInfo("combobox", "com2");

      I wanted change the combobox's value to com2,but it didn't works,the value still is com1,it didn't change to com2.

      My quetions is the code of funciton swDoc.set_CustomInfo() works first time,from the second time it didn't work,I think it's the type of combobox affect it.

      Anyone knows how to fix this?Thank you.

        • Re: set_CustomInfo didn't work
          Rajat Jain



          Use the following lines of code: -


          swDoc.set_CustomInfo("combobox", "com2");

          combobox.selectedItem = "com2";



          Hope it helps!!!


          Rajat Jain

            • Re: set_CustomInfo didn't work
              Jason King

              Hi,Rajat Jain.Sorry maybe I mistake you.The combobox it's not a windows control.It's a custom property I set in the Property Tab Builder(It's a solidworks own tool).The combobox's type is list.It's looks like this:


              And this code:

              swDoc.set_CustomInfo("combobox", "com1");

              It works in solidworks application.After the code works,solidworks application's property edit page looks like this:




                • Re: set_CustomInfo didn't work
                  JOHN GEORGE

                  I think the property is set to configuration specific

                  You could try with custom properties in your property tab builder


                  custom property.png

                    • Re: set_CustomInfo didn't work
                      Jason King

                      Sorry,my mistake.All pictures are example.I have set all the properties with custom properties.

                      My question is when I change property with code by this function swDoc.set_CustomInfo().

                      When it's a textbox like this:


                      The code works well.Textbox's value changed.But when it's a combobox like this:


                      The code works only the first time.The combobox's value changed.From the second time I used the code.The combobox's value never change.