Safe way to test if a polyline reference is ok to access its properties.

Safe way to test if a polyline reference is ok to access its properties.

oneMSN
Advocate Advocate
485 Views
2 Replies
Message 1 of 3

Safe way to test if a polyline reference is ok to access its properties.

oneMSN
Advocate
Advocate

I am hooked into the Database_ObjectModified event.  I have a particular interest in polylines.  When one is drawn I wish to do stuff with it.  However I Have an issue with polylines which are generated by other operations, one case I have seen is when I do a point move action on a dynamic block, the database event offers up these polylines which I think may be part of a Jig!?? related to the moving of the dynamic entity.  

My problem is I cant find a way to Identify these entities in a safe way so that I can ignore them.

 

I always have to deal with them by exception.  one example I have is this:

            try
            {
                var testPropertyAccess = polyline.PolylineEntity.BlockName.Length;
            }
            catch
            {
                // Improper polyline.
                return;
            }

Other time I get a bad geometry error. or some other error when accessing the properties.  

Is there any good safe way of determining if a polyline is actually one that the user has drawn rather than one of these temporary lines?

 

 

0 Likes
Accepted solutions (1)
486 Views
2 Replies
Replies (2)
Message 2 of 3

ActivistInvestor
Mentor
Mentor
Accepted solution
Perhaps you missed my reply to your other post re. eDegenerateGeometry?
Message 3 of 3

oneMSN
Advocate
Advocate

Yes I did.  I will look now!

0 Likes