How to copy data link from old objectId to new objectId
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm trying to copy all data from a subject in my drawing, such as all objects in the line number tag. However, it is not working. Could someone help me with this issue?
Thanks!
PlantProject currentProj = PlantApplication.CurrentProject;
PipingProject pipingProj = (PipingProject)currentProj.ProjectParts["Piping"];
DataLinksManager dlm = pipingProj.DataLinksManager;
foreach (ObjectId objId in allObjects)
{
int rowId = dlm.FindAcPpRowId(objId);
if (rowId != -1)
{
// Get new object ID after cloning
ObjectId newObjId = acIdMap[objId].Value;
// Copy data links from old object ID to new object ID
dlm.CopyRow(rowId, newObjId);
}
}
Severity Code Description Project File Line Suppression State
Error CS1061 'DataLinksManager' does not contain a definition for 'CopyRow' and no accessible extension method 'CopyRow' accepting a first argument of type 'DataLinksManager' could be found (are you missing a using directive or an assembly reference?)
Link copied