ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing an entities type

5 REPLIES 5
Reply
Message 1 of 6
james3785
421 Views, 5 Replies

Changing an entities type

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!

5 REPLIES 5
Message 2 of 6
loic.jourdan
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
Message 3 of 6
james3785
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

Message 4 of 6
owenwengerd
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
Message 5 of 6


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

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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

Message 6 of 6
vianova.th
in reply to: james3785

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

40 - Radius  << you missing this

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost