Select to view content in your preferred language

Read only attribute error in Python program

564
0
07-07-2010 06:19 AM
QuinnMcCarthy
Deactivated User
I have this python program that creates line features in a line FC created by the program.

I also add the field to the FC called tao_name. When I set that field to the value I need it fails and the error says that tao_name is a read only attribute.

Here is the part where it errors out.

  
    while sRow:
        print cOwner, sRow.tao_name, SrcX, SrcY, Row
        pt.id = Row

        if cPrevO <> sRow.tao_name:
            cPrevO = sRow.tao_name
            #cOwner = sRow.tao_name
           
        if cPrevO == sRow.tao_name and Row >= 2:
            feat = iCur.NewRow()
            DestX = sRow.CenX
            DestY = sRow.CenY
            pt.x = SrcX
            pt.y = SrcY
            lineArray.add(pt)
            pt.x = DestX
            pt.y = DestY
            lineArray.add(pt)
            feat.shape = lineArray
            iCur.tao_name = sRow.tao_name ** Errors here
            iCur.InsertRow(feat)
            lineArray.RemoveAll()
            SrcX = DestX
            SrcY = DestY
            cPrevO = cOwner
           
        Row = Row + 1           
           
        sRow = sCur.Next()

                                                                                                            
    lineArray.RemoveAll()

I have tried using setvalue and that didn't help

Thanks

Quinn
0 Kudos
0 Replies