ObjectARX

Reply
New Member
james3785
Posts: 2
Registered: ‎10-01-2012
Message 1 of 6 (168 Views)

Changing an entities type

168 Views, 5 Replies
10-01-2012 05:47 AM

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!

Valued Contributor
loic.jourdan
Posts: 53
Registered: ‎01-24-2006
Message 2 of 6 (163 Views)

Re: Changing an entities type

10-01-2012 06:23 AM in reply to: james3785

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.

 

 

----
20-20 CAD / 20-20 Technologies
New Member
james3785
Posts: 2
Registered: ‎10-01-2012
Message 3 of 6 (153 Views)

Re: Changing an entities type

10-01-2012 07:10 AM in reply to: james3785

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

Distinguished Mentor
owenwengerd
Posts: 645
Registered: ‎08-06-2002
Message 4 of 6 (145 Views)

Re: Changing an entities type

10-01-2012 07:59 AM in reply to: james3785

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
Moderator
Alexander.Rivilis
Posts: 1,433
Registered: ‎04-09-2008
Message 5 of 6 (136 Views)

Re: Changing an entities type

10-01-2012 11:55 AM in reply to: james3785

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")

 


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Contributor
vianova.th
Posts: 23
Registered: ‎09-16-2011
Message 6 of 6 (125 Views)

Re: Changing an entities type

10-02-2012 07:44 PM in reply to: james3785

to get circle you need at least these DXF
0 - CIRCLE
10 - Center point

40 - Radius  << you missing this

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.