Issue with Handle References in Copied Polylines in AutoCAD Plugin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Problem Statement:
In my AutoCAD plugin, I associate a text entity with a polyline by storing the text’s handle value inside the polyline’s extension dictionary. This allows me to retrieve the associated text later using the stored handle.
However, when I copy and paste the polyline along with the text, AutoCAD generates new handle values for both the polyline and the text. The problem is that the copied polyline’s extension dictionary still contains the original text’s handle value, instead of the newly generated handle for the pasted text.
Expected Behavior:
When a polyline is copied and pasted along with its associated text, the newly created polyline should store the handle of the newly created text entity in its extension dictionary, rather than retaining the old (source) text handle.
Question:
How can I update the pasted polyline’s extension dictionary to store the new text handle instead of the original one? Is there an event or mechanism in AutoCAD’s API that allows updating handle references for copied entities?
Would appreciate any insights or suggestions!