Autodesk ObjectARX
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Changing an entities type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi all,
I was wondering how to change an entity's type (DXF group code 2) using ObjectARX. I have been able to extract the currenty entity type AcDbEntGet. I have been able to change other properties of the entity using the AcDbEntMod function, however, it does not appear to allow me to change the type.
Is anyone able to advise me on how I can do this? I am currently looking at AcDbBlockTableRecord to see if there is someway to do it using this.
Cheers,
James!
Re: Changing an entities type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Not sure to understand correctly since I'm not extremely confortable with dxf codes.
Maybe this can help:
Changing an entity type in object arx is not possible by simply changing a property (you can't ask a line to become an arc for instance), this requires erasing the source entity and creating a new one of the type you want (erase the line, create a new arc).
In my mind, the dxf entity type is a read-only property.
I hope this helps.
Re: Changing an entities type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank you, yes I have been able to erase the entity by obtaining the AcDbEntity pointer (and calling erase()). However I am having trouble creating a new custom entity in its place. The entity exists in the toolplallet so I assume its a case of using the acutBuildList command and then acdbEntMake. For example I thought this code would insert a circle -
struct resbuf *entlist,*eb;
ads_point first = {3208.2, 956.295, 0.0};
char* layer = "0";
entlist = acutBuildList(0, "CIRCLE",// Entity type
8, layer, // Layer name
10, first,
100, "AcDbCircle",
100, "AcDbEntity",
0 );
acdbEntMake(entlist);However the Circle doesn't seem to insert. Any suggestions?
Thanks,
James
Re: Changing an entities type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Please provide some information about your environment (AutoCAD version, OS), the return values from the calls to acutBuildList and acdbEntMake, and the context from which these calls take place.
Owen Wengerd
ManuSoft
Re: Changing an entities type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
james3785 wrote:
...I was wondering how to change an entity's type (DXF group code 2) using ObjectARX...
First of all entity's type DXF group is 0 (zero)!
DXF group 2 is the name of block (if entity's type is "INSERT")
Re: Changing an entities type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
to get circle you need at least these DXF
0 - CIRCLE
10 - Center point
40 - Radius << you missing this



