1 Reply Latest reply on Jul 29, 2014 9:31 PM by Patrick.Cashman

    reading page titles

    karl.kechele

      Hello,

      we want to change the titles of pages in the DxDesigner via API.

      When setting an attribute value with the function "setAttrValue2(key, value)"

      the attribute will be changed. We can see the new title by opening the sheet in DxDesigner.

      Later we want to read the new title.

      We use the function "FindAttribute(attr)" to find our attribute and then we read the property "Value".

      But this property does not contain the new title ! It contains the title before we did change it.

      When reading the attribute property "InstanceValue" we get an empty string.

       

      Our question: How can we read a changed attribute property?

       

      We use the Mentor Flow EE7.9.3.

       

      Thank you.

        • 1. Re: reading page titles
          Patrick.Cashman

          Here is the basics of what I have successfully used many times to get and set attribute values:

           

          Dim comp As ViewDraw.Component

          Dim attr As ViewDraw.Attribute

           

          'first set comp so that it has a reference to the correct symbol

           

          'then:

          attr = comp.FindAttribute("Part Number")

          If Not attr Is Nothing Then

               pn = attr.Value

           

               'you could also do something like:

               attr.value = "your new value"

          End If

           

           

          'another example:

           


          attr = comp.FindAttribute("Ref Designator")

          If Not attr Is Nothing Then

               refdes_loc = attr.GetLocation

               refdes_size = attr.Size

               refdes_origin = attr.Origin

               refdes_orientation = attr.Orientation

          Else

               MsgBox("reference designator not found on subject part")

          End If

           

           

          Hope this helps.