Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, How can i get and set Documentation info (Hyperlink, notes ) of Extended data of an object by .Net ?
Thank you
Solved! Go to Solution.
Hi, How can i get and set Documentation info (Hyperlink, notes ) of Extended data of an object by .Net ?
Thank you
Solved! Go to Solution.
All Entity objects have the Hyperlinks collection which holds all of the hyperlinks attached to that Entity. Not sure what you mean by notes, though.
Thanks. I need to set and get fields that shown in attached image.
As @Jeff_M points out, the Hyperlinks are contained in the Hyperlinks property on the Autodesk.AutoCAD.DatabaseServices.Entity. The notes can be found in the extension dictionary of the Autodesk.AutoCAD.DatabaseServices.DBObject. Use the ExtensionDictionary property to obtain the objectId of the dictionary. It will be opened as a DBDictionary. The entry key that you are looking for is "AEC_TEXT_NOTE". Its value will return an objectId which can then be opened as an Autodesk.AEC.DatabaseServices.TextNote. The text note has a property called "Note" that will contain the contents of the Notes added to the ExtendedData tab of the properties palette.
To add to what @hippe013 shared, you can also get the list of documents attached using the "AEC_REF_DOCS" dictionary. Here's a short example demonstrating this:
//this will contain the first hyperlink
var hl = aeccEnt.Hyperlinks[0].DisplayString;
var prs = aeccEnt.ExtensionDictionary;
var dict = (DBDictionary)prs.GetObject(OpenMode.ForRead);
//this is the Reference Documents
var docsEntry = (ObjectId)dict["AEC_REF_DOCS"];
var docs = (DBDictionary)docsEntry.GetObject(OpenMode.ForRead);
var dictEnum = docs.GetEnumerator();
var pathList = new List<string>();
while(dictEnum.MoveNext())
{
var refdoc = (Autodesk.Aec.DatabaseServices.ReferenceDocument)((ObjectId)dictEnum.Value).GetObject(OpenMode.ForRead);
pathList.Add(refdoc.FileFullPath);
}
//and this is the Notes
var noteEntry = (ObjectId)dict["AEC_TEXT_NOTE"];
var notes = (Autodesk.Aec.DatabaseServices.TextNote)noteEntry.GetObject(OpenMode.ForRead);
var actualNoteText = notes.Note;
Thank you so much :))
Oh, wow I guess I should have checked Civil 3D forum first, I did not realize this was a C3D-Only property.
I just posted over HERE asking if this was possible.
Does anyone know if this is possible with AutoLISP / Visual Lisp?
Best,
~DD
@CodeDing in a quick test, no can do in lisp.
(setq ent (vl-sel))
(setq extdict (vla-getextensiondictionary ent))
(setq notes (vla-item extdict "AEC_TEXT_NOTE"))
(vlax-get notes 'note)
Notes is set to an object:
but the last line returns:
; error: ActiveX Server returned the error: unknown name: "NOTE"
Do you have an example of this in C#?
@Daniel.Sotelo.EDP look at message #5 in this thread.