Author Topic: "Entity" and "Object"  (Read 13418 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
"Entity" and "Object"
« on: November 04, 2006, 07:16:46 PM »
.....................
On a related note, what's the difference between an "Entity" and an "Object"?   ^-^

Interesting related note !
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Chuck Gabriel

  • Guest
Re: "Entity" and "Object"
« Reply #1 on: November 04, 2006, 07:45:27 PM »
An object is a database-resident chunk of data.  An entity is an object that has a graphical representation.

JohnK

  • Administrator
  • Seagull
  • Posts: 10572
Re: "Entity" and "Object"
« Reply #2 on: November 04, 2006, 08:45:16 PM »
^^ couldnt have put it better
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Dinosaur

  • Guest
Re: "Entity" and "Object"
« Reply #3 on: November 04, 2006, 09:40:55 PM »
Hmm . . . Civil 3D . . . There are no entities at all, only "Civil 3D objects" that are expressed on screen by whatever style is assigned to it.  It can be copied and assigned a different style making the copy look completely different yet it is still the same "object" - change the data for the object and both copies are affected by the change instantly.  No part of the "object" can be selected individually except in some circumstances when the style of a component or its label can be changed.  The styles assigned to the group and all of its components control their visibility, layer and all other properties that can normally be assigned via the layer dialog within normal AutoCAD.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: "Entity" and "Object"
« Reply #4 on: November 04, 2006, 10:00:11 PM »
Must admit, I've always used the names interchangably ...

According to the docs, internally AutoCAD refers to objects as entities  ... a statement I have never really understood  :oops:


kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: "Entity" and "Object"
« Reply #5 on: November 05, 2006, 12:37:13 AM »
To summarize the already brief blurb int the dxf reference, objects are units of data that have no graphical representation; entities are merely graphical objects ... and given the respective lists of properties and methods for both --

AcadObject
===== Properties =====
Application
Database
Document
Handle
HasExtensionDictionary
ObjectID
ObjectName
OwnerID
===== Methods =====
Delete
Erase
GetExtensionDictionary
GetXData
SetXData

AcadEntity
===== Properties =====
Application
Color
Database
Document
EntityName
EntityType
Handle
HasExtensionDictionary
Hyperlinks
Layer
Linetype
LinetypeScale
Lineweight
ObjectID
ObjectName
OwnerID
PlotStyleName
TrueColor
Visible
===== Methods ======
ArrayPolar
ArrayRectangular
Copy
Delete
Erase
GetBoundingBox
GetExtensionDictionary
GetXData
Highlight
IntersectWith
Mirror
Mirror3D
Move
Rotate
Rotate3D
ScaleEntity
SetXData
TransformBy
Update


-- noting that entities sport all the methods and properties of objects but not the other way round I'll suggest that AcadEntity is likely derived from AcadObject.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

sinc

  • Guest
Re: "Entity" and "Object"
« Reply #6 on: November 05, 2006, 12:45:58 AM »
An object is a database-resident chunk of data.  An entity is an object that has a graphical representation.

By that definition, toolbar and menu items would be entities, because they have a graphical representation, right?

sinc

  • Guest
Re: "Entity" and "Object"
« Reply #7 on: November 05, 2006, 12:50:25 AM »
To summarize the already brief blurb int the dxf reference, objects are units of data that have no graphical representation; entities are merely graphical objects ... and given the respective lists of properties and methods for both --

So what would you say something like a PVI in a FGProfile is?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: "Entity" and "Object"
« Reply #8 on: November 05, 2006, 01:24:26 AM »
So what would you say something like a PVI in a FGProfile is?

I've no clue since I've never worked with Land Desktop (had to do a google search to find a reference to it). I'd hazard a guess that it's probably not much more than a simple structure or collection class that need not inherit the AcadObject properties / methods (doesn't exhibit the "is a" AcadObject trait) but as noted, I've never played with LDD so I'll stop my speculation there.

:)

Edit: Tried to fix the grammar but I think it's worse now. Obviously time for bed; night all.
« Last Edit: November 05, 2006, 01:33:16 AM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

MickD

  • King Gator
  • Posts: 3603
  • (x-in)->[process]->(y-out) ... simples!
Re: "Entity" and "Object"
« Reply #9 on: November 05, 2006, 01:36:59 AM »
An object is a database-resident chunk of data.  An entity is an object that has a graphical representation.

What Chuck said above with a slight difference, as AcDbEntity derives from AcDbObject ('the' base database class from memory), entities too reside in the dwg database and you must override the filer in/out as well as the world/viewportDraw() methods of AcDbEntity when you derive from it. The only difference is an 'entity' in this sense has a graphical representation whereas an 'object' does not.
A 'custom object' is a bit of a misguiding name for what most expect it to be, while you can create a custom 'object' most uses for them are graphical by nature but this is not always the case, you can create classes that simply store data say, you would derive these from AcDbObject instead of AcDbEntity.

edit - Sorry Chuck, after reading your sentence a few more times you did say the same thing, I just elaborated a bit more perhaps :)
« Last Edit: November 05, 2006, 01:38:28 AM by MickD »
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Crank

  • Water Moccasin
  • Posts: 1503
Re: "Entity" and "Object"
« Reply #10 on: November 05, 2006, 08:55:45 AM »
From Autodesk's DXF-references:
Quote
Object and Entity Codes
In the DXF™ format, the definition of objects differs from entities: objects
have no graphical representation and entities do. For example, dictionaries
are objects, and not entities. Entities are also referred to as graphical objects
while objects are referred to as nongraphical objects.
Entities appear in both the BLOCK and ENTITIES sections of the DXF file. The
use of group codes in the two sections is identical.
Some group codes that define an entity always appear; others are optional
and appear only if their values differ from the defaults.
Do not write programs that rely on the order given here. The end of an entity
is indicated by the next 0 group, which begins the next entity or indicates the
end of the section.
Vault Professional 2023     +     AEC Collection

sinc

  • Guest
Re: "Entity" and "Object"
« Reply #11 on: November 05, 2006, 11:37:59 AM »
An object is a database-resident chunk of data.  An entity is an object that has a graphical representation.
From Autodesk's DXF-references:
Quote
Object and Entity Codes
In the DXF™ format, the definition of objects differs from entities: objects
have no graphical representation and entities do.

OK, sounds like everyone agrees that all Entities are Objects, but not all Objects are Entities.  Again, what about toolbars, which have a graphic representation, but are considered Objects and not Entities (according to Autodesk's documentation)?  And what about something like a COGO Point, which is considered an Entity (also according to Autodesk's documentation), but is stored in a separate database, and therefore has no DXF representation?

In standard usage in computer programming, an Entity Object is an object that incorporates "business logic", or logic specific to the particular application.  Entity Objects would typically not be reused in writing another application, because they are very specific to the task at hand.  This is in contrast to generic Objects, such as UI elements, data structures, etc.

Entities in Autocad are similar.  From what I gather, it seems that Autodesk considers an Entity to be an Object that can have a graphical representation IN A DRAWING.  That does not mean that the object has to exist in a DWG file - in other words, an Entity might not have a DXF representation.  But it would still be an Entity.  On the other hand, a Toolbar Item would be an Object, but not an Entity, because it does not have a graphical representation IN THE DRAWING.

A Block seems to be considered an Object because it has no direct representation in the drawing.  However, a Block is a collection of Entities, and the Entities have a representation in the drawing.  Similarly, a Linetype defines display properties for Entities, but has no direct representation in the drawing, so it is an Object.  Layers, Materials, PlotConfigurations, TextStyles, UCSs, all of these are Objects.

As an interesting quirk, this also means a Paperspace Viewport is an Entity, while a View is an Object.

In Vanilla Autocad, there are actually no Entities that are not stored in the DWG file.  That is not true in Land Desktop, however, where items like COGO Points and Finish Grade Profiles are stored in the Project, but still considered to be Entities.

But the answer is not at all clear-cut.  It is interesting to note the differences between Land Desktop and Civil-3D.  In Land Desktop, an Alignment is an Object, composed of a collection of Entities like AlignTangent, AlignCurve, AlignSpiral, EGProfile, and FGProfile.  In Civil-3D, however, the Alignment is now an Entity, and its horizontal layout is considered a property of the Alignment.  Profiles are still Entities in their own right, but the EGProfile and FGProfile Entities have been combined into a single Profile Entity.  PVIs used to be Entities in Land Desktop; in Civil-3D, they are considered Properties of Profiles Enitites.

Similarly, a Surface is an Object in Land Desktop that contains a collection of Entities like Breaklines and Boundaries.  In Civil-3D, a Surface is considered to be an Entity in its own right.

So, it seems that what constitutes an Entity depends in large part in how you look at it...   :wink:

Crank

  • Water Moccasin
  • Posts: 1503
Re: "Entity" and "Object"
« Reply #12 on: November 05, 2006, 12:51:11 PM »
The question is: Does it matter if you considere an entity as an object?
In Alisp (when you can use the entitylist), I consider the item as an entity, but in Vlisp it's an object to me.
Vault Professional 2023     +     AEC Collection

Serge J. Gianolla

  • Guest
Re: "Entity" and "Object"
« Reply #13 on: November 05, 2006, 03:17:36 PM »
No, no, no!
Objects used to be called entities in past before the catholic church had a go at Autodesk! LOL



Dinosaur

  • Guest
Re: "Entity" and "Object"
« Reply #14 on: November 05, 2006, 10:37:04 PM »
Sinc, I am still not convinced that Civil 3D objects such as profiles or surfaces are actually entities.  We are EXTREMELY limited with the types of manipulation that can be performed on them.  You can not even copy a profile although they can be created multiple times and they can not be moved at all within their profile view.  You can forget the other modify commands except explode which has its own peculiarity.  They can be modified with grips, but this is actually a method of inputting new data from which it is created as all copies of this profile react immediately to the new data.  There are native AutoCAD primitives within it but to get to them, the profile must be exploded into a block and the resulting block must then be exploded into lines and arcs.  Also of note, if there is only one copy of this profile or surface and it is exploded, the definition is gone and short of a successfull run of white knuckle "undo"s, they have to be recreated from scratch or restored from a backup.  I do not know what the dxf from one of these looks like, but I know that unless they are exploded down to primitives they come back as either proxy objects or zombie entities when the dxf is imported by an earlier AutoCAD version.
How can they be an entity if they can not be manipulated by most regular methods?  What about things like point groups or profile views?