3 Replies Latest reply on May 15, 2014 9:54 PM by JJ_jiang

    How to find a textbox in a specific location on a sheet?

    heatwole

      Is there a way to tell/search if there is an annotation textbox at a certain location? For instance I have schematic sheets with a textbox in the upper lefthand corner with a page title. I want to automatically see if that page already has a title (at that specific location in the upper lefthand corner), in which case I want to delete it and replace it with a new user specified title.

       

      Thanks.

        • 1. Re: How to find a textbox in a specific location on a sheet?
          andrew.french

          should be able to accomplish what you need by using the Query Method.  Recommend looking at the documentation for more information but you can tell it to query your text items and then you would iterate through the objects and look for the item you need.

          1 of 1 people found this helpful
          • 2. Re: How to find a textbox in a specific location on a sheet?
            heatwole

            Yes, this is what I was figuring. The key for me was to search the annotation layer and also to check to make sure that the type actually is text (text.type = 2). Because that query was also coming up with circle objects and getlocation() was failing.

             

            For each text in Application.ActiveView.Query(VDTL_ANNOTATION,VD_ALL)

                            if text.type = 2 then

                                loc(0) =  text.getlocation().X

                                loc(1) = text.getlocation().Y

                                if loc(0) = x and loc(1) = y then

                                    text.selected = true

                                    ActiveView.Block.DeleteSelected(True)

                                End if

                            End if

            Next

            • 3. Re: How to find a textbox in a specific location on a sheet?
              JJ_jiang

              Nowadays, could we edit the procedure in Flotherm for the second research?

              if ok,how to do it as your suggestion?

               

               

               

              thanks