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
    2009-04
    Posts
    1

    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:
    Code:
    //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. Save structured data in an entity
    By jason907238 in forum Dot Net API
    Replies: 19
    Last Post: 2012-08-29, 07:06 PM
  2. Getting object Data Table Name from Entity
    By sunsat05463998 in forum VBA/COM Interop
    Replies: 0
    Last Post: 2012-03-20, 10:04 AM
  3. Exporting Entity Data With Timeliner
    By dfrancis in forum NavisWorks - General
    Replies: 6
    Last Post: 2010-05-05, 05:41 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
  •