.NET

Reply
Member
thesniper2003eng
Posts: 3
Registered: ‎01-25-2007
Message 1 of 3 (277 Views)

Entity vs Entity2d

277 Views, 2 Replies
08-02-2012 08:18 PM

Can someone tell me the difference between DatabaseServices.Entity and Geometry.Entity2d

 

When should I use each one of them?

 

Regards,

 

*Expert Elite*
_gile
Posts: 2,072
Registered: ‎04-29-2006
Message 2 of 3 (255 Views)

Re : Entity vs Entity2d

08-03-2012 04:00 AM in reply to: thesniper2003eng

DatabaseServices.Entity is the base class for all database objects having a graphical representation.

 

Geometry.Entity2d is an abstract base class for all point set classes. Any class that is derived from this class represents a set of points in 2D space. These have not a graphical representation and are used for geometry calculations.

 

Gilles Chanteau
Distinguished Contributor
khoa.ho
Posts: 149
Registered: ‎09-15-2011
Message 3 of 3 (240 Views)

Re: Entity vs. Entity2d

08-03-2012 08:03 AM in reply to: thesniper2003eng

I think the best comparison is DatabaseServices.Entity and Geometry.Entity3d.

Both Entity and Entity3d are abstract classes. Entity has derived classes such as Line, Circle, Hatch..., Entity3d has derived classes such as Curve3d, Line3d...

Entity is inherited from DBObject so it has ObjectId to store on DWG database for graphical presentation.
Entity3d is more lightweight, but its derived classes have all geometry calculations that Entity and its derived classes don't have.

For example, if we want to find projected/apparent intersection points between a line and an ellipse, we don't use Line and Circle entities (derived from Entity) and write our own math calculation. Instead, we will use Line3d and EllipticalArc3d objects (derived from Entity3d) and use method EllipticallArc3d.ProjectedIntersectWith() to make the life easier.

In short, if we want to store entities on DWG database, use Entity's derived classes. If we just want to do some advanced geometry calculations, use Entity3d's derived classes to make use of all built-in math functions.

 

-Khoa

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community