TheSwamp

Code Red => .NET => Topic started by: ekoneo on April 21, 2014, 09:01:41 AM

Title: What does the meaning of "Retrive attribute failed" error message?
Post by: ekoneo on April 21, 2014, 09:01:41 AM
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?
Title: Re: What does the meaning of "Retrive attribute failed" error message?
Post by: Jeff_M 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.
Title: Re: What does the meaning of "Retrive attribute failed" error message?
Post by: ekoneo on April 21, 2014, 10:29:35 AM
Thanks Jeff_M;
Thats true..
I should make up a way  ^-^
Title: Re: What does the meaning of "Retrive attribute failed" error message?
Post by: ekoneo 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: