Author Topic: Reading ACAD_DATALINK Information via ActiveX / Visual  (Read 1005 times)

0 Members and 1 Guest are viewing this topic.

MrSmith

  • Newt
  • Posts: 23
Reading ACAD_DATALINK Information via ActiveX / Visual
« on: May 12, 2021, 09:38:40 PM »
I am trying to figure out how you can read the dictionary information on the ACAD_DATALINK objects using vla only commands. Starting with autolisp commands, I can do

Code - Auto/Visual Lisp: [Select]
  1. (setq datalinkDict (dictsearch (namedobjdict) "ACAD_DATALINK"))
  2.  
  3. Returns:
  4. ((-1 . <Entity name: 15ebbc13920>) (0 . "DICTIONARY") (5 . "4CA") (102 . "{ACAD_REACTORS") (330 . <Entity name: 15ebbc038c0>) (102 . "}") (330 . <Entity name: 15ebbc038c0>) (100 . "AcDbDictionary") (280 . 1) (281 . 1) (3 . "Excel Data Link 1") (360 . <Entity name: 15ebbc13930>) (3 . "Excel Data Link 2") (360 . <Entity name: 15ebbc13df0>))
  5.  
  6. (setq datalink (dictsearch (cdr (assoc -1 datalinkDict)) "Excel Data Link 1"))
  7.  
  8. Returns:
  9. ((-1 . <Entity name: 15ebbc13930>) (0 . "DATALINK") (5 . "4CB") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 15ebbc1bce0>) (102 . "}") (102 . "{ACAD_REACTORS") (330 . <Entity name: 15ebbc13920>) (102 . "}") (330 . <Entity name: 15ebbc13920>) (100 . "AcDbDataLink") (1 . "AcExcel") (300 . "") (301 . "Data Link\nExcel Data Link 1\nC:\\Users\\xxx\\Desktop\\Test\\TEST.xlsx\nLink details: Range: B10:I15") (302 . "C:\\Users\\xxx\\Desktop\\Test\\TEST.xlsx!Sheet1!B10:I15") (90 . 2) (91 . 67895297) (92 . 1) (170 . 2021) (171 . 5) (172 . 12) (173 . 23) (174 . 2) (175 . 14) (176 . 0) (177 . 3) (93 . 0) (304 . "") (94 . 2) (330 . <Entity name: 15ebbc0ea90>) (330 . <Entity name: 15ebbc13950>) (360 . <Entity name: 15ebbc13940>) (305 . "CUSTOMDATA") (1 . "DATAMAP_BEGIN") (90 . 3) (300 . "ACEXCEL_CONNECTION_STRING") (301 . "DATAMAP_VALUE") (93 . 2) (90 . 4) (1 . "C:\\Users\\xxx\\Desktop\\Test\\TEST.xlsx!Sheet1!B10:I15") (94 . 0) (300 . "") (302 . "") (304 . "ACVALUE_END") (300 . "ACEXCEL_SOURCEDATE") (301 . "DATAMAP_VALUE") (93 . 2) (90 . 8) (92 . 16) (310 . "E507250003000F0010003B0004000C00") (94 . 0) (300 . "") (302 . "") (304 . "ACVALUE_END") (300 . "ACEXCEL_UPDATEOPTIONS") (301 . "DATAMAP_VALUE") (93 . 2) (90 . 1) (91 . 67895297) (94 . 0) (300 . "") (302 . "") (304 . "ACVALUE_END") (309 . "DATAMAP_END"))
  10.  

I try to do the same with vla commands.
Code - Auto/Visual Lisp: [Select]
  1. (vlax-for it (vlaGetItem (vla-get-dictionaries *acdoc*) "ACAD_DATALINK") (dump it nil))
  2.  
  3. Returns:
  4. ; IAcadObject: The standard interface for a basic AutoCAD object
  5. ; Property values:
  6. ;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff77f7f51a8>
  7. ;   Document (RO) = #<VLA-OBJECT IAcadDocument 0000015ea0437b88>
  8. ;   Handle (RO) = "4CB"
  9. ;   HasExtensionDictionary (RO) = -1
  10. ;   ObjectID (RO) = 901
  11. ;   ObjectName (RO) = "AcDbDataLink"
  12. ;   OwnerID (RO) = 902
  13.  

As you can see, the handles match "4CB" which tells me I am looking at the right object but I don't see any way of reading its information. I tried reading its XData using the GetXData method but it returned nothing. I noticed it as an extension dictionary but neither it nor the extension dictionary's extension dictionary had any information in either its collection or XData. I've ran around in circle for awhile but seem unable to figure out how to access its dictionary information. Searching on google has led me to believe it is not possible, which seems very strange.....


Here are the two dumps on the extension dictionaries. I did not include the searching of the XData as they returned nothing. The script for searching XData on objects did work fine on OLE objects though, so I think it was working properly.
Code - Auto/Visual Lisp: [Select]
  1. (vlax-for it (vlaGetItem (vla-get-dictionaries *acdoc*) "ACAD_DATALINK") (dump (vla-getExtensionDictionary it) nil))
  2. ; IAcadDictionary: A container object for storing and retrieving objects
  3. ; Property values:
  4. ;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff77f7f51a8>
  5. ;   Count (RO) = 0
  6. ;   Document (RO) = #<VLA-OBJECT IAcadDocument 0000015ea0437b88>
  7. ;   Handle (RO) = "6EE"
  8. ;   HasExtensionDictionary (RO) = 0
  9. ;   Name = AutoCAD.Application: Not applicable
  10. ;   ObjectID (RO) = 880
  11. ;   ObjectName (RO) = "AcDbDictionary"
  12. ;   OwnerID (RO) = 901
  13. ; IAcadDictionary: A container object for storing and retrieving objects
  14. ; Property values:
  15. ;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff77f7f51a8>
  16. ;   Count (RO) = 0
  17. ;   Document (RO) = #<VLA-OBJECT IAcadDocument 0000015ea0437b88>
  18. ;   Handle (RO) = "6EF"
  19. ;   HasExtensionDictionary (RO) = 0
  20. ;   Name = AutoCAD.Application: Not applicable
  21. ;   ObjectID (RO) = 900
  22. ;   ObjectName (RO) = "AcDbDictionary"
  23. ;   OwnerID (RO) = 885
  24.  
  25. (vlax-for it (vlaGetItem (vla-get-dictionaries *acdoc*) "ACAD_DATALINK") (dump (vla-getextensiondictionary (vla-getExtensionDictionary it)) nil))
  26. ; IAcadDictionary: A container object for storing and retrieving objects
  27. ; Property values:
  28. ;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff77f7f51a8>
  29. ;   Count (RO) = 0
  30. ;   Document (RO) = #<VLA-OBJECT IAcadDocument 0000015ea0437b88>
  31. ;   Handle (RO) = "703"
  32. ;   HasExtensionDictionary (RO) = 0
  33. ;   Name = AutoCAD.Application: Not applicable
  34. ;   ObjectID (RO) = 875
  35. ;   ObjectName (RO) = "AcDbDictionary"
  36. ;   OwnerID (RO) = 880
  37. ; IAcadDictionary: A container object for storing and retrieving objects
  38. ; Property values:
  39. ;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff77f7f51a8>
  40. ;   Count (RO) = 0
  41. ;   Document (RO) = #<VLA-OBJECT IAcadDocument 0000015ea0437b88>
  42. ;   Handle (RO) = "704"
  43. ;   HasExtensionDictionary (RO) = 0
  44. ;   Name = AutoCAD.Application: Not applicable
  45. ;   ObjectID (RO) = 874
  46. ;   ObjectName (RO) = "AcDbDictionary"
  47. ;   OwnerID (RO) = 900
  48.  
  49.