Results 1 to 1 of 1

Thread: how to get an entity's object data and change another entity's object data?

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    Login to Give a bone

    Default how to get an entity's object data and change another entity's object data?

    My program is under autodeskmap2005 and c#2005.I want to get an entity's object data ,and then set this entity's object data to another entity.Now I don't know how to get the object data from an entity .Please help me!Thank you very much!

    Sorry for my poor english.

    My code is list as follows:
    //select source entity
    object select = null;
    object basePnt = null;
    acadApp.ActiveDocument.Utility.GetEntity(out select, out basePnt, "select source entity:");
    AcadEntity sourceEntity = select as AcadEntity;
    //select target entity 
    object select2 = null;
    object basePnt2 = null;
    acadApp.ActiveDocument.Utility.GetEntity(out select2, out basePnt2, "select target entity:");
    AcadEntity targetEntity= select2 as AcadEntity;
    // get datatable of sourceentity
    AutocadMAP.AcadMap map = acadApp.GetInterfaceObject("AutoCADMap.Application") as AcadMap; AutocadMAP.Project p = map.Projects.Item(0);
    string sourceEntityTableName = "";
    //how to get sourceentity's objectdata's tablename?I cann't work it out.
    AutocadMAP.ODTable table = p.ODTables.Item(sourceEntityTableName);
    AutocadMAP.ODRecords records = table.GetODRecords();
    records.Init(targetEntity, true, false);
    //assign sourceentity's objectdata to targetEntity;
    I didn't test the sentence.This sentence must be wrong
    Last edited by Opie; 2009-05-07 at 09:09 PM. Reason: [code] tags added

Similar Threads

  1. 2014: Added object data fields to Polyline, but object data is empty or zero
    By tntdraftsol in forum AutoCAD Map 3D - General
    Replies: 6
    Last Post: 2015-07-24, 12:20 PM
  2. PR34-3: Extended Entity Data
    By Autodesk University in forum Computer Programming
    Replies: 0
    Last Post: 2012-11-24, 07:38 PM
  3. Getting object Data Table Name from Entity
    By sunsat05463998 in forum VBA/COM Interop
    Replies: 0
    Last Post: 2012-03-20, 10:04 AM
  4. Getting subentity data from entity. . .
    By M. Kubitza in forum AutoLISP
    Replies: 4
    Last Post: 2009-06-06, 11:26 AM
  5. Object data from entity to FDO Feature data property
    By vlee in forum AutoCAD Map 3D - Data Connect (FDO)
    Replies: 3
    Last Post: 2009-04-09, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts