10 Replies Latest reply on Aug 11, 2010 2:46 AM by mans.joling

    Edit a cell

    mans.joling

      Hi

       

      I want to edit a cell which has been already placed.

      It is a mechanical cell where I want to change some text fields

      In the attached doc file you see some fields with XXXX which have to be changed.

      Have somebody a piece of code to start.

       

      Regards

       

      Mans

        • 1. Re: Edit a cell
          Satoru

          Hi Mans-san,

           

          The test case has DrawCell:DrawList and has placed it.

          The DrawCell:DrawList has three user layer texts.

           

          In order to distinguish the three texts, I added the property.

          Property Name: editFlag

          Value: "DATE", "NAME", "MODEL"

          The properties can be seen by Script "Show_Properties.vbs".

           

          If Edit_Draw_List.vbs is run, three texts will change.

          Please try!

           

          This test case was made by EE2007.8.

           

          Regards,

          Satoru

          • 2. Re: Edit a cell
            mans.joling

            Hi Satoru

             

            I try to understand what is happening but how do you add the "editflag" property to the text in a cell.

             

            Regards

             

            Mans-san

            • 3. Re: Edit a cell
              Satoru

              Hi Mans-san,

               

              I added the property to Text by using PutProperty Method of UserLayerText Object.

               

                  Dim usrTxt
                  Dim attr
                 
                  Set usrTxt = pcbDoc.UserLayerTexts(epcbSelectSelected, "*", True).Item(1)
                  Set attr = usrTxt.PutProperty("editFlag", "NAME")

               

              Satoru

              • 4. Re: Edit a cell
                mans.joling

                Hi Satoru,

                 

                Can I add the "editflag" property and his value to every text by hand on the mechanical header cell's that I want in the library.
                Or can this only be done thru automation (in the Library).

                Have a nice weekend.

                 

                Regards

                 

                Mans-san.

                • 5. Re: Edit a cell
                  Satoru

                  Hi Mans-san,

                   

                  I added the property in the Cell Editor by Automation.

                   

                  It can add also in the mechanical cell.

                   

                  Satoru

                  • 6. Re: Edit a cell
                    mans.joling

                    Hi Satoru

                     

                    I have 20 mechanical cell's with 18 text's each which must have a unique value for the "Editflag" property.

                    Is there a simple way to do this because by hand it is not possible.

                     

                    Regards

                     

                    Mans-san

                    • 7. Re: Edit a cell
                      Satoru

                      Hi Mans-san,

                       

                      I don't have an idea...

                      sorry.

                       

                      Satoru

                      • 8. Re: Edit a cell
                        mans.joling

                        Hi Satoru

                         

                        I known how to do it I use HKP in and out

                        I have edit a cell.hkp and try now to display the property values bys I get the error object required on the msgbox line

                         

                            Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")
                            Scripting.AddTypeLibrary("MGCPCB.Application")

                            '---------------------------------------
                            'add your code here
                            '---------------------------------------
                            Dim cmps, cmp
                            Dim usrTxts, usrTxt
                            Dim attr
                        'epcbSelectPlaced, epcbCompGeneral,
                            Set cmps = pcbDoc.Components(epcbSelectPlaced, epcbCompGeneral,epcbCelltypeMechanical, "*")
                            For Each cmp In cmps
                                If cmp.CellName = "PKOP05" Then
                                    Set usrTxts = cmp.UserLayerTexts
                                    For Each usrTxt In usrTxts
                                        usrTxt.Selected = True
                                        Set attr = usrTxt.FindProperty("editFlag")
                                       MsgBox (attr.Name & "   " & "Property Value= " & attr.Value)
                                        usrTxt.Selected = False
                                    Next
                                End If
                            Next

                        • 9. Re: Edit a cell
                          Satoru

                          Hi Mans-san,

                           

                          My Draw Cell has placed the three same text characters.

                          Automation can't distinguish a text character.

                          Therefore, I used the property.

                           

                          Text characters distinguishable in Mans's mechanical cell can directly edit or show.

                          Please run a script.

                           

                          Satoru

                          • 10. Re: Edit a cell
                            mans.joling

                            Hi Satoru

                             

                            This works fine for me.

                            I shall try to change the text fields thru automation

                            Thank you.

                             

                            Regards

                             

                            Mans-san