Changing an entities type

Changing an entities type

Anonymous
Not applicable
1,090 Views
5 Replies
Message 1 of 6

Changing an entities type

Anonymous
Not applicable

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!

0 Likes
1,091 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

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.

 

 

Message 3 of 6

Anonymous
Not applicable

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

0 Likes
Message 4 of 6

owenwengerd
Advisor
Advisor

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
0 Likes
Message 5 of 6

Alexander.Rivilis
Mentor
Mentor

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

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 6 of 6

Anonymous
Not applicable

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

40 - Radius  << you missing this

0 Likes