Author Topic: What does the meaning of "Retrive attribute failed" error message?  (Read 1193 times)

0 Members and 1 Guest are viewing this topic.

ekoneo

  • Newt
  • Posts: 66
When I renumber cogopoints whith:
Code: [Select]
for (uint i = 1, j = 1; i <100; i++)
                {
                    if (!civdoc.CogoPoints.Contains(i))
                    {
                    }
                    else
                    {
                        CogoPoint pt = (CogoPoint)civdoc.CogoPoints.GetPointByPointNumber(i).GetObject(AcDb.OpenMode.ForWrite);
                        pt.Renumber(j, PointNumberResolveType.Overwrite);
                        j++;
                    }
                   
                }

"Retrive attribute failed" error message occured..  Does anybody know the reason?

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: What does the meaning of "Retrive attribute failed" error message?
« Reply #1 on: April 21, 2014, 10:11:52 AM »
It appears that this exception is thrown when you attempt to renumber a point to the same number. So you cannot renumber point # 1 to # 1.

ekoneo

  • Newt
  • Posts: 66
Re: What does the meaning of "Retrive attribute failed" error message?
« Reply #2 on: April 21, 2014, 10:29:35 AM »
Thanks Jeff_M;
Thats true..
I should make up a way  ^-^

ekoneo

  • Newt
  • Posts: 66
Re: What does the meaning of "Retrive attribute failed" error message?
« Reply #3 on: April 21, 2014, 10:55:44 AM »
Thans Jeff_M;

I solved the problem by adding code part belowe:
Code: [Select]
if (pt.PointNumber != j)
                        {
                            pt.Renumber(j, PointNumberResolveType.Overwrite);
                            j++;
                        }
                        else
                        {
                            j++;
                        }

by the way renumber oparation ignoring when the point number is the same with for cycle's i value  :kewl: