• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk ObjectARX

    Reply
    New Member
    Posts: 2
    Registered: ‎10-01-2012

    Changing an entities type

    109 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!

    Please use plain text.
    Contributor
    Posts: 17
    Registered: ‎01-24-2006

    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.

     

     

    Please use plain text.
    New Member
    Posts: 2
    Registered: ‎10-01-2012

    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

    Please use plain text.
    Mentor
    Posts: 239
    Registered: ‎08-06-2002

    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
    Please use plain text.
    Moderator
    Alexander.Rivilis
    Posts: 1,168
    Registered: ‎04-09-2008

    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

    Please use plain text.
    Contributor
    vianova.th
    Posts: 20
    Registered: ‎09-16-2011

    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

    Please use plain text.