<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Transfer Link Template to Object Data in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11330487#M12183</link>
    <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;I have been researching on this topic for a long time, what I want is to transfer the values of the LINK TEMPLATE fields to the OBJECT DATA fields as I show in the image is a process that would help me a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a .dwg file with two OBJECT DATA tables which are connected to a MS Access database by means of a LINK TEMPLATE with the same names as shown in the &lt;A href="https://autode.sk/3oHHBK1" target="_blank" rel="noopener"&gt;SCREENCASTS&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BriamR_0-1659205539322.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1098486i5404BA42DD181FA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BriamR_0-1659205539322.png" alt="BriamR_0-1659205539322.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BriamR_1-1659205548293.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1098487i2E1595673DADBF9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BriamR_1-1659205548293.png" alt="BriamR_1-1659205548293.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked at these options but without achieving something concrete&lt;/P&gt;&lt;P&gt;&lt;A title="grupo fleming" href="http://acad.fleming-group.com/Download/ADOLisp/ADOLisp.html" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT&gt;1. ADOLisp&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="plantas" href="https://forums.augi.com/showthread.php?26283-MS-Access-and-Object-data" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT&gt;2. MS-Access-and-Object-datos&lt;/FONT&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A title="tutor" href="https://www.cadtutor.net/forum/topic/28632-ms-access-to-attributes/" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT&gt;3. ms-acceso-a-atributos&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT&gt;I attach the .mdb and .dwg files that serve as an example for this topic.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me with a routine that does this task automatically and faster?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help if you have it.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Sat, 30 Jul 2022 19:46:54 GMT</pubDate>
    <dc:creator>BriamR</dc:creator>
    <dc:date>2022-07-30T19:46:54Z</dc:date>
    <item>
      <title>Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11330487#M12183</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;I have been researching on this topic for a long time, what I want is to transfer the values of the LINK TEMPLATE fields to the OBJECT DATA fields as I show in the image is a process that would help me a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a .dwg file with two OBJECT DATA tables which are connected to a MS Access database by means of a LINK TEMPLATE with the same names as shown in the &lt;A href="https://autode.sk/3oHHBK1" target="_blank" rel="noopener"&gt;SCREENCASTS&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BriamR_0-1659205539322.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1098486i5404BA42DD181FA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BriamR_0-1659205539322.png" alt="BriamR_0-1659205539322.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BriamR_1-1659205548293.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1098487i2E1595673DADBF9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BriamR_1-1659205548293.png" alt="BriamR_1-1659205548293.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked at these options but without achieving something concrete&lt;/P&gt;&lt;P&gt;&lt;A title="grupo fleming" href="http://acad.fleming-group.com/Download/ADOLisp/ADOLisp.html" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT&gt;1. ADOLisp&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="plantas" href="https://forums.augi.com/showthread.php?26283-MS-Access-and-Object-data" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT&gt;2. MS-Access-and-Object-datos&lt;/FONT&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A title="tutor" href="https://www.cadtutor.net/forum/topic/28632-ms-access-to-attributes/" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;FONT&gt;3. ms-acceso-a-atributos&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT&gt;I attach the .mdb and .dwg files that serve as an example for this topic.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me with a routine that does this task automatically and faster?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help if you have it.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 30 Jul 2022 19:46:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11330487#M12183</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2022-07-30T19:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11333714#M12184</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5743681"&gt;@BriamR&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I not used it before and I don't know how to use it, you have a video look&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I looked at it a little&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But you have one KeyValues Can two KeyValues I mean the first and second fields KeyValues&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 21:11:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11333714#M12184</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2022-08-01T21:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11333736#M12185</link>
      <description>Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6591997"&gt;@hosneyalaa&lt;/a&gt;&lt;BR /&gt;The keyvalues is only one in the DB and in the LT, for each table the keyvalues is INTERNO_DEMARCACION and INTERNO_SENAL. thanks for your interest in the publication</description>
      <pubDate>Mon, 01 Aug 2022 21:26:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11333736#M12185</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2022-08-01T21:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11334318#M12186</link>
      <description>&lt;P&gt;hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5743681"&gt;@BriamR&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Get the following values after the key need arrangement See the video&lt;/P&gt;&lt;P&gt;and connect it with OBJECT DATA fields needs time&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I find time, I will try it&lt;/P&gt;&lt;P&gt;Can someone provide help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 379px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1099162i129E74ADCEB49E9A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Q10.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1099164iA82C87FC2A4BB55D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Q10.gif" alt="Q10.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attach the Lisp&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captureq.JPG" style="width: 800px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1099166i5A28805A95FAB30A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Captureq.JPG" alt="Captureq.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 06:04:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11334318#M12186</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2022-08-02T06:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11335854#M12187</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6591997"&gt;@hosneyalaa&lt;/a&gt;thanks for the help and interest in solving the issue, greetings, I hope someone in the forum can help me with the issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been reviewing this method and I think I can use it but I still can't make an effective or coherent routine to help me with transferring LT to OD.&amp;nbsp;&lt;A href="https://jtbworld.com/autocad-cao-link-templates-lsp" target="_blank" rel="noopener"&gt;CAO_Link_Templates.lsp&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 19:18:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11335854#M12187</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2022-08-02T19:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11337318#M12188</link>
      <description>&lt;P&gt;I assume you want to develop this with AutoCAD .NET API.&lt;/P&gt;&lt;P&gt;I have never used AutoCAD MAP Object Data but I have used AutoCAD CAO.&lt;/P&gt;&lt;P&gt;Why don't you start writing some code and see what happens?&lt;/P&gt;&lt;P&gt;I can help with issues related to CAO but nothing related to Object Data.&lt;/P&gt;&lt;P&gt;At first I think that it is only possible to migrate data from CAO to Object Data as long as the CAO.KeyValues ​​fields are equal to the ObjectData.FieldDefinition fields (same data source).&lt;/P&gt;&lt;P&gt;The caotest.dvb (VBA) example can be used for learning purposes. Other useful content:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.autodesk.com/autodesk-university/class/Harnessing-Power-AutoCAD-COM-APIs-2015" target="_blank" rel="noopener"&gt;https://www.autodesk.com/autodesk-university/class/Harnessing-Power-AutoCAD-COM-APIs-2015&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 11:29:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11337318#M12188</guid>
      <dc:creator>Gepaha</dc:creator>
      <dc:date>2022-08-03T11:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11343414#M12189</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/565180"&gt;@Gepaha&lt;/a&gt; Thank you for your interest in the publication. I will try to make some lines as you recommend, because I don't have much experience in programming. I am still open to your help in terms of a code that can migrate or transfer the information from LT to OD. Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2022 01:52:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11343414#M12189</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2022-08-06T01:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11345155#M12190</link>
      <description>&lt;P&gt;You did not give details on how you want to transfer/conversion done: is it one-time operation, so that the entities' linked data will be converted into ObjectData attached to the same entities and afterward, you do not need the entities being linked to the data any more; or, you want to entities still to be data linked (thus the attached ObjectData may be out of sync, if the data changes).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is also other possibilities. For example, if you know which data fields in the database's table to be used as ObjectData, then you can directly get the database from the database and use it in the ObjectData fields (e.g. bypassing the need to converting/transferring from data linked entities, unless you must use the linked data to identify the entities).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/565180"&gt;@Gepaha&lt;/a&gt;&amp;nbsp;pointed out, you would need use CAO 1.0 COM components to access data linked entities, and then create corresponding ObjectData (table/record). It can be done either with VBA, or .NET API. I suspect that is no existing, generic tool readily for you to use (because CAO is quite old technology), so, you need to have, a bit of, advanced AutoCAD/Map programming knowledge/skill for this task. If you want to it yourself, expect steeper learning curve, and preferably, you do it with .NET API, rather than VBA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 18:49:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11345155#M12190</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-08-07T18:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11345182#M12191</link>
      <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt; thank you very much for your interest in the subject.&lt;BR /&gt;&lt;BR /&gt;Regarding the information that I did not provide, I would like to comment the following details,&lt;BR /&gt;1. When the operation of transferring the LT to the OD is done, it must be a copy of information that keeps the entity or drawing linked to the database regardless of the fact that this is not synchronized by subsequent changes in value.&lt;BR /&gt;2. The values of the OD and LT and DB fields are the same, that is to say, the copy or conversion/transfer from LT or DB to OD can be made, and yes, the data linked through the LT are identifiers of each entity or graphic element with OD.&lt;BR /&gt;&lt;BR /&gt;Thanks again for commenting on this publication, I remain attentive to any clarification to be made on this issue. And yes! I am dabbling in this programming as it is very useful and interesting to save time in work processes, so I turn to this forum asking for your help. Regards</description>
      <pubDate>Sun, 07 Aug 2022 19:18:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11345182#M12191</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2022-08-07T19:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11347089#M12192</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5743681"&gt;@BriamR&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to look at lisp at comment&amp;nbsp; show link data&lt;/P&gt;&lt;P&gt;&amp;nbsp;It gives you the results you want From the LT fields&lt;/P&gt;&lt;P&gt;Then you associate it with the OD fields Through the Lisp that you attached&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 18:48:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11347089#M12192</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2022-08-08T18:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11414752#M12193</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6591997"&gt;@hosneyalaa&lt;/a&gt;, Try to run these lisp with support from caotets.lsp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:LT2OD( LTs linkTemplate linkSel objId 
			      / link txtLinkData selectedObj selectedObjID linkKeyValues
			      linkindex KeyType KeyValue strKeyValue lstLinkData linkTypes strLinkTypes ss)
  ;; Load the ActiveX stuff for Visual LISP
  (vl-load-com)

  ;; Save a reference to the active drawing document.
  (setq acadObj (vlax-get-acad-object)
	acadDoc (vla-get-ActiveDocument acadObj)  ) ; This acadDoc global is used throughout this file.

  (setq gCmnFiles (getenv "COMMONPROGRAMFILES") 
	gCaoTlb (strcat gCmnFiles "\\AUTODESK SHARED\\" "cao20enu.tlb")
	gADO-DLLpath (strcat gCmnFiles "\\system\\ado\\msado15.dll"))


  (if (null (findfile gADO-DLLpath))
      (progn
	(alert (strcat "Could not load ADO type library from: " gADO-DLLpath)) 
	(exit)
      )
  )
  ;; Import the ADO type library
  ;; Note: We must provide prefixes for these methods and properties because some conflict
  ;; with protected LISP symbols such as APPEND().
  (if (null adok-adStateOpen)            ; Check that ADO type library has not yet been loaded.
      (vlax-import-type-library :tlb-filename gADO-DLLpath)
  )

  ;; Import the CAO type library.
  (if (null GetLinkTemplates)
      (vlax-import-type-library :tlb-filename gCaoTlb)
  )
  
  ;; Define a global variable, dbConnect
  ;;(InitDbConnect)
  
  (setq dbConnect (vla-getinterfaceobject (vlax-get-acad-object) "CAO.DbConnect.20"))
  (setq LTs (vlax-invoke-method dbConnect "GetLinkTemplates")) ; All linkTemplates in current drawing.

    (setq linkKeyValues (vlax-get-property link "KeyValues"))
    (if (null linkKeyValues)
	(setq lstOutput  (append lstOutput (list "No key value is defined")))

	(vlax-for OneKeyValue linkKeyValues

		  (setq KeyValue (vlax-variant-value (vlax-get-property OneKeyValue "Value"))
			KeyType (type KeyValue))

		  (cond
		   ((equal vlax-vbString KeyType)
		    (setq strKeyValue (strcat "'" KeyValue  "'" ))
		    )
		   ((or
		     (equal vlax-vbInteger KeyType)
		     (equal vlax-vbLong KeyType)
		     (equal vlax-vbSingle KeyType)
		     (equal vlax-vbDouble KeyType)
		     (equal 'INT KeyType)
		     (equal 'REAL KeyType)
		     )
		    (setq strKeyValue (vl-princ-to-string KeyValue))
		    )
		   ((equal vlax-vbBoolean KeyType)
		    (if (equal :vlax-true KeyValue)
			(setq strKeyValue "True")
		      (setq strKeyValue "False"))
		    )
		   ((equal 'STR KeyType)
		    (setq strKeyValue (strcat "'" KeyValue  "'" ))
		    )
		   (t
		    (setq strKeyValue  "Unknown type")
		    )
		  );_cond

		  (setq lstLinkData (append lstLinkData
					    (list (strcat (vlax-get-property OneKeyValue "FieldName") ": " strKeyValue))))

        );_vlax-for OneKeyValue linkKeyValues
      );_if not null keyValues

)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:LTOD( / LTs linkTemplate linkSel keyValues keyDescriptions keyDescsCount index)
  ;; Load the ActiveX stuff for Visual LISP
  (vl-load-com)

  ;; Save a reference to the active drawing document.
  (setq acadObj (vlax-get-acad-object)
	acadDoc (vla-get-ActiveDocument acadObj)  ) ; This acadDoc global is used throughout this file.

  (setq gCmnFiles (getenv "COMMONPROGRAMFILES") 
	gCaoTlb (strcat gCmnFiles "\\AUTODESK SHARED\\" "cao20enu.tlb")
	gADO-DLLpath (strcat gCmnFiles "\\system\\ado\\msado15.dll"))


  (if (null (findfile gADO-DLLpath))
      (progn
	(alert (strcat "Could not load ADO type library from: " gADO-DLLpath)) 
	(exit)
      )
  )
  ;; Import the ADO type library
  ;; Note: We must provide prefixes for these methods and properties because some conflict
  ;; with protected LISP symbols such as APPEND().
  (if (null adok-adStateOpen)            ; Check that ADO type library has not yet been loaded.
      (vlax-import-type-library :tlb-filename gADO-DLLpath)
  )


  ;; Import the CAO type library.
  (if (null GetLinkTemplates)
      (vlax-import-type-library :tlb-filename gCaoTlb)
  )

  
  (setq dbConnect (vla-getinterfaceobject (vlax-get-acad-object) "CAO.DbConnect.20"))
  (setq LTs (vlax-invoke-method dbConnect "GetLinkTemplates")) ; All linkTemplates in current drawing.

  (vlax-for thisLT LTs  
	    ;; Dump the Link Template
	    (princ (vlax-dump-object thisLT))

	    ;; Get all links in this drawing which use this link template
	    (setq linkSel (vlax-invoke-method DbConnect "Getlinks" thisLT ))
	    (vlax-for thisLink linkSel
		      (princ (vlax-dump-object thisLink))
		      (setq KeyValues (vlax-get-property thisLink "KeyValues"))
		      (vlax-for thisKey KeyValues
				(princ (vlax-dump-object thisKey))
		      )
            )
  )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-09-11 213652.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1114444iEC59EADCCECF0DE5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-09-11 213652.png" alt="Screenshot 2022-09-11 213652.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Even without achieving much, I get the error I show, any help you can give me to run these lisp where I can transfer the Link Template to the Object Data, thank you, greetings.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 02:44:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11414752#M12193</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2022-09-12T02:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11415682#M12194</link>
      <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;You can complete with this code&lt;BR /&gt;Code adapted from caotets.lsp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(defun c:TESSTDLink (/ ACADDOC ACADOBJ ADOCONNECT CMD COUNT DBCONNECT ENT1 GADO-DLLPATH GCAOTLB GCMNFILES
		LA_OBJ_IDS LINKTEMPLATE LINKTEMPLATENAME LIST_FIELD_TARGET LSTALLROWS LTGETGETLABELTEMPLATES
		LTGETQUERIES LTS L_FIELD L_OBJ_ID OBJ OB_ID PKEYDESCS PKEYVALUES RS SELECTEDROWINDEX STRCOLUMNNAMES
		STRKEYNAME TBL THISKEYVALUE THISVALUE THISVALUE0 THISVALUE1 TYP_TARGET TYP_TARGET0 XS0 XS0Q)
  
(vl-load-com)



  ;; Load the ActiveX stuff for Visual LISP
  (vl-load-com)
   (setq dbConnect (vla-getinterfaceobject (vlax-get-acad-object) "CAO.DbConnect.20"))
  ;; Save a reference to the active drawing document.
  (setq acadObj (vlax-get-acad-object)
	acadDoc (vla-get-ActiveDocument acadObj)  ) ; This acadDoc global is used throughout this file.


  ;; (setq linkTemplates (vl-catch-all-apply 'caom-GetLinkTemplates (list dbConnect acadDoc)))

  (setq gCmnFiles (getenv "COMMONPROGRAMFILES") 
	gCaoTlb (strcat gCmnFiles "\\AUTODESK SHARED\\" "cao20enu.tlb")
	gADO-DLLpath (strcat gCmnFiles "\\system\\ado\\msado15.dll"))


  (if (null (findfile gADO-DLLpath))
      (progn
	(alert (strcat "Could not load ADO type library from: " gADO-DLLpath)) 
	(exit)
      )
  )
  ;; Import the ADO type library
  ;; Note: We must provide prefixes for these methods and properties because some conflict
  ;; with protected LISP symbols such as APPEND().
  (if (null adok-adStateOpen)            ; Check that ADO type library has not yet been loaded.
      (vlax-import-type-library :tlb-filename gADO-DLLpath
     	  :methods-prefix "adom-"
 	  :properties-prefix "adop-"
 	  :constants-prefix "adok-"
      )
  )


  ;; Import the CAO type library.
  (if (null caom-GetLinkTemplates)           ; Check that CAO type library has not yet been loaded.
      (vlax-import-type-library :tlb-filename gCaoTlb
     	  :methods-prefix "caom-"
 	  :properties-prefix "caop-"
 	  :constants-prefix "caok-"
   ))



  
;;; Get the object and get the object ID    
(setq ent1 (car (entsel "\nSelect entity to erase links")))
(setq Obj (vlax-ename-&amp;gt;vla-object ent1))
(setq ob_ID (vla-get-objectid Obj))


;;; Instantiate the DBConnect object
(setq dbConnect (vlax-create-object "CAO.DbConnect.20"))

  
;prepare the keydescriptions
(setq pKeyDescs (vla-GetInterfaceObject (vlax-get-acad-object)"CAO.KeyDescriptions.20"))

  
;prepare the keydescriptions
(setq pKeyValues (vla-GetInterfaceObject (vlax-get-acad-object)"CAO.KeyValues.20"))


  
;;; Get the GetLabelTemplates    
(setq LTGetGetLabelTemplates (vlax-invoke-method dbConnect "GetLabelTemplates"))

  
  


;;; Get the linkTemplates     (setq lA_Obj_IDS NUL)
(setq LTs (vlax-invoke-method dbConnect "GetLinkTemplates"))
 
  (vlax-for  LT LTs
    
    (vlax-for thisLink (vlax-invoke-method dbConnect "GetLinks" LT nil nil nil)
      
      (setq l_Obj_ID (vlax-get-property thisLink "ObjectID"))
      
      
      (if (= l_Obj_ID ob_ID)
	
	(setq lA_Obj_IDS (CONS thisLink lA_Obj_IDS))
	
	)
      )
    )

(setq linkTemplate (CAR lA_Obj_IDS))
  (setq linkTemplatename (vlax-get-property (vlax-get-property linkTemplate "linkTemplate") "Name") ) 

   (setq thisKeyValue (vlax-invoke-method (vlax-get-property linkTemplate "KeyValues") "Item" 0) )
  
  (setq strKeyName (vlax-get-property thisKeyValue "FieldName"))
  (setq thisValue (vlax-variant-value (vlax-get-property thisKeyValue "Value")))
 

  

  
  
  
  
  
  


 (setq adoconnect nil)
  (setq ADOConnect (vlax-create-object "ADODB.Connection") )

   (cmdConnectDataSource_Click linkTemplate) 

 (setq Count  0
	cmd (vlax-create-object "ADODB.Command"))

  (vlax-put-property cmd "ActiveConnection" ADOConnect)
  (vlax-put-property cmd "CommandTimeout"  30)
  (vlax-put-property cmd "CommandText" (strcat"SELECT * from " 
					      (vlax-get-property (vlax-get-property linkTemplate "linkTemplate") "Table")))

  (setq rs nil)	
  (setq rs (vlax-create-object "ADODB.Recordset"))
  (vlax-invoke-method rs "OPEN" cmd nil adok-adOpenDynamic adok-adLockBatchOptimistic adok-adCmdUnknown)



  
  (princ (strcat "\n " (itoa (vlax-get-property rs "recordCount")) " Rows"))


 

  (princ (printFieldNames rs nil))
  (princ  "\n")
  (princ  "\n")
  (princ  "\n")








  )


;;;
;;;  
;;;
;;;  (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
;;;  (vla-regen acDoc acAllViewports)
;;;
;;;  

  



  
       

















  



;;;--------------------------------------------------------------------;
;;; Connect to the datasource and table for this linkTemplate.         ;
;;; Display the ADODB Connection object's Version and Provider info.   ;
;;;--------------------------------------------------------------------;
(defun cmdConnectDataSource_Click( linkTemplate	; Pass in linkTemplate argument, or nil
				   /  strDataSourceLoc strDataSource
				     currConnectionString )

;;;  (if (null linkTemplate) (setq linkTemplate (getLinkTemplate)) )


  (setq strDataSourceLoc (strcat (vlax-get-property dbConnect "DataSourceLocation") "\\")
	strDataSource (vlax-get-property (vlax-get-property linkTemplate "linkTemplate") "DataSource") ) 


  (if adoConnect
      (if (= adok-adStateOpen (vlax-get-property ADOConnect "State"))
	  (vlax-invoke-method ADOConnect "Close")))
  (setq adoconnect nil)
  (setq ADOConnect (vlax-create-object "ADODB.Connection") ) ; ADOConnect is a global

  (setq currConnectionString (strcat "File Name=" strDataSourceLoc strDataSource 
				     ".udl;User ID=;Password=;" ))

  (vlax-put-property ADOConnect "ConnectionString" currConnectionString)
  (vlax-invoke-method ADOConnect "Open" currConnectionString "" "" -1) ; LISP seems to require args which should be optional... 


;;;  (if (= adok-adStateOpen (vlax-get-property ADOConnect "State"))
;;;      (alert (strcat strDataSource " is connected."
;;;		     "\nVersion = " (vlax-get-property ADOCOnnect "Version")
;;;		     " Provider = " (vlax-get-property ADOCOnnect "Provider")))
;;;    (alert (strcat "Unable to connect to " strDataSource))
;;;  )

  (setq status_string (strcat "ADODB.Connection.OPEN( " 
			      "File Name=" strDataSource 
			      ".udl;User ID=;Password=;" ))
)









;;;--------------------------------------------------------------------;
;;; printFieldNames() accepts an ADODB.RecordSet object and returns a  ;
;;; string containing the column names for this RecordSet's Fields.    ;
;;;--------------------------------------------------------------------;
(defun printFieldNames( rs bPrint / strColumnNames fields fieldsIndex thisField padStr
			   fieldsCount thisFieldDefinedSize thisFieldName )
  
  (setq strColumnNames ""
	padStr         "")

  (setq fields (vlax-get-property rs "Fields")
	fieldsCount (1- (vlax-get-property fields "Count")) ; zero-based index
	fieldsIndex 0)

  (while (&amp;lt;= fieldsIndex fieldsCount)
    (setq thisField (vlax-get-property fields "item" fieldsIndex)) ; Item is a property not a method for recordSet fields...
    (setq thisFieldDefinedSize (vlax-get-property thisField "DefinedSize")
	  thisFieldName (vlax-get-property thisField "Name"))

    
    (if (&amp;lt; fieldsIndex fieldsCount) ; Don't output final comma after last fieldname
	(setq strColumnNames (strcat strColumnNames thisFieldName ", "))
      (setq strColumnNames (strcat strColumnNames thisFieldName))
      )
    (setq fieldsIndex (1+ fieldsIndex))
    )

  ;; Print these field-names
    (if bPrint
	(princ (strcat "\n" strColumnNames "\n")))
  

  strColumnNames	; Return this value
)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To show the values in the lines use this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;;;;--------------------------------------------------------------------;
;;; Utility function which accepts an ADODB.RecordSet object and a boolean.
;;; Each record in the recordSet is converted to a list of strings.    ;
;;; This routine returns a list of these list-of-string records.       ;
;;;                                                                    ;
;;; Set 2nd arg, bPrint == T to print records to screen, otherwise nil ;
;;; to just return the recordset fields as a list-of-list-of-string.   ;
;;;--------------------------------------------------------------------;
(defun printFieldValues( rs bPrint / fields fieldsIndex thisField rowIndex lstAllRows
			    fieldsCount strFieldValue strOneRow thisValue )

  (while (not (equal :vlax-true (vlax-get-property rs "EOF")))
    
    (setq fields (vlax-get-property rs "Fields")
	  fieldsCount (1- (vlax-get-property fields "Count")) ; zero-based index
	  fieldsIndex 0
	  strOneRow nil)

    ;; Print out record count:
    ;;  (princ (setq (strcat "\nThere are " (vl-princ-to-string fieldsCount)  " fields:\n\n")))


    (while (&amp;lt;= fieldsIndex fieldsCount)
      (setq thisField (vlax-get-property fields "item" fieldsIndex)) ; Item is a property not a method for recordSet fields...
      (setq thisValue (vlax-variant-value (vlax-get-property thisField "Value")))
      
      (setq strFieldValue (vl-princ-to-string thisValue))
      
      (setq strOneRow (append strOneRow (list strFieldValue)))
      (if (&amp;lt; fieldsIndex fieldsCount ) ; Don't output final comma after last fieldname
	  (setq strOneRow (append strOneRow (list ", ")))
	)
      (setq fieldsIndex (1+ fieldsIndex))
     );_while fieldsIndex
    
    
    (setq lstAllRows (cons (apply 'strcat strOneRow) lstAllRows))

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; Display these field-names
    (if bPrint
	(progn
	  (princ (apply 'strcat strOneRow))
	  (princ "\n")
	)
    )
    
    (vlax-invoke-method rs "MoveNext") ; Move to next row in recordSet.
    
    );_while not yet at RecordSet EOF

  (setq lstAllRows (reverse lstAllRows)) ; Return this big list of all rows.
)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SD.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1114603i06B521DCD7EA01A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="SD.gif" alt="SD.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 12:17:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11415682#M12194</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2022-09-12T12:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11840304#M12195</link>
      <description>&lt;LI-CODE lang="general"&gt;(defun c:LT_OD (/ dwg ss sdm-dem-demarcacion sdm-dem-inter-demarcacion sdm-dem-clase-demarcacion link-template link-template-field db-file db-table db-field db-clase-field conn rs int-dem clase-dem)
  (setq dwg (vlax-get-acad-object))
  (setq ss (ssget))
  (setq sdm-dem-demarcacion "SDM_DEM_DEMARCACION")
  (setq sdm-dem-inter-demarcacion "INTERNO_DEMARCACION")
  (setq sdm-dem-clase-demarcacion "CLASE_DEMARCACION")
  (setq link-template "SDM_DEM_DEMARCACION")
  (setq link-template-field "INTERNO_DEMARCACION")
  (setq db-file (strcat (getvar 'dwgprefix) "SIGMOVILIDAD_2012.mdb"))
  (setq db-table "DEM_DEMARCACION")
  (setq db-field "INTERNO_DEMARCACION")
  (setq db-clase-field "CLASE_DEMARCACION")
  (setq conn (vl-catch-all-apply 'vla-get-activedocument (list dwg)))
  (setq rs (vl-catch-all-apply 'vlax-create-object (list "ADODB.Recordset")))
  (foreach obj (vl-remove-if-not 'vla-object-&amp;gt;ename (mapcar 'vlax-ename-&amp;gt;vla-object (ssnamex ss)))
    (if obj
      (progn
        (setq int-dem (vla-putproperty obj link-template link-template-field))
        (vl-catch-all-apply 'vlax-invoke-method rs "Open" (list (strcat "SELECT * FROM " db-table " WHERE " db-field "=" int-dem) conn))
        (if (not (vlax-invoke-method rs "EOF"))
          (progn
            (setq clase-dem (vlax-invoke-method (vlax-get-property rs "Fields") db-clase-field "Value"))
            (vla-putproperty obj sdm-dem-demarcacion sdm-dem-inter-demarcacion int-dem)
            (vla-putcustomstringdata obj sdm-dem-demarcacion sdm-dem-clase-demarcacion clase-dem)
          )
        )
        (vlax-invoke-method rs "Close")
      )
    )
  )
  (princ)
  (princ "Valores de campos copiados con éxito a Object Data.")
  (princ)
  (prin1)
)&lt;/LI-CODE&gt;&lt;P&gt;I have been working with this code to solve the issue of copying the LT in the OD; it generates the following ; error: bad argument type: lentityp (0 &amp;lt;Entity name: 1f248ae1f30&amp;gt; 3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still trying to get the expected result, any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 19:55:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11840304#M12195</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2023-03-22T19:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11846778#M12196</link>
      <description>&lt;P&gt;change&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(vl-remove-if-not 'vla-object-&amp;gt;ename (mapcar 'vlax-ename-&amp;gt;vla-object (ssnamex ss)))&lt;/LI-CODE&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(mapcar 'vlax-ename-&amp;gt;vla-object (mapcar 'cadr (ssnamex ss)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;; error:

          no function definition: VLA-PUTPROPERTY&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 08:53:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11846778#M12196</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2023-03-25T08:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11847638#M12197</link>
      <description>&lt;P&gt;I added this at the beginning of the code, but the error persists...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  (vl-load-com)
  (setq acad (vlax-get-acad-object))
  (setq doc (vla-get-activedocument acad))
  (setq modelspace (vla-get-modelspace doc))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Command: LTOD
1 found
; error: no function definition: VLA-PUT&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 21:29:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11847638#M12197</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2023-03-25T21:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11849039#M12198</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5743681"&gt;@BriamR&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Re :&lt;/P&gt;&lt;PRE&gt;Command: LTOD
1 found
; error: no function definition: VLA-PUT&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd surmise you have a redundant space in one of the function names.&lt;BR /&gt;Perhaps do a search for VLA-PUT&amp;lt;space&amp;gt; for the culprit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Re:&lt;/P&gt;&lt;PRE&gt;; error:

          no function definition: VLA-PUTPROPERTY&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps you wanted VLA-PUT-PROPERTY&amp;nbsp; ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 22:26:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11849039#M12198</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-03-26T22:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11849428#M12199</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5743681"&gt;@BriamR&lt;/a&gt;&amp;nbsp; test&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(defun c:TESSTDLinkv (/ )
  
(vl-load-com)



  ;; Load the ActiveX stuff for Visual LISP
  (vl-load-com)
   (setq dbConnect (vla-getinterfaceobject (vlax-get-acad-object) "CAO.DbConnect.20"))
  ;; Save a reference to the active drawing document.
  (setq acadObj (vlax-get-acad-object)
	acadDoc (vla-get-ActiveDocument acadObj)  ) ; This acadDoc global is used throughout this file.


  ;; (setq linkTemplates (vl-catch-all-apply 'caom-GetLinkTemplates (list dbConnect acadDoc)))

  (setq gCmnFiles (getenv "COMMONPROGRAMFILES") 
	gCaoTlb (strcat gCmnFiles "\\AUTODESK SHARED\\" "cao20enu.tlb")
	gADO-DLLpath (strcat gCmnFiles "\\system\\ado\\msado15.dll"))


  (if (null (findfile gADO-DLLpath))
      (progn
	(alert (strcat "Could not load ADO type library from: " gADO-DLLpath)) 
	(exit)
      )
  )
  ;; Import the ADO type library
  ;; Note: We must provide prefixes for these methods and properties because some conflict
  ;; with protected LISP symbols such as APPEND().
  (if (null adok-adStateOpen)            ; Check that ADO type library has not yet been loaded.
      (vlax-import-type-library :tlb-filename gADO-DLLpath
     	  :methods-prefix "adom-"
 	  :properties-prefix "adop-"
 	  :constants-prefix "adok-"
      )
  )


  ;; Import the CAO type library.
  (if (null caom-GetLinkTemplates)           ; Check that CAO type library has not yet been loaded.
      (vlax-import-type-library :tlb-filename gCaoTlb
     	  :methods-prefix "caom-"
 	  :properties-prefix "caop-"
 	  :constants-prefix "caok-"
   ))



  
;;; Get the object and get the object ID    
(setq ent1 (car (entsel "\nSelect entity ")))
(setq Obj (vlax-ename-&amp;gt;vla-object ent1))
(setq ob_ID (vla-get-objectid Obj))


;;; Instantiate the DBConnect object
(setq dbConnect (vlax-create-object "CAO.DbConnect.20"))

  
;prepare the keydescriptions
(setq pKeyDescs (vla-GetInterfaceObject (vlax-get-acad-object)"CAO.KeyDescriptions.20"))

  
;prepare the keydescriptions
(setq pKeyValues (vla-GetInterfaceObject (vlax-get-acad-object)"CAO.KeyValues.20"))


  
;;; Get the GetLabelTemplates    
(setq LTGetGetLabelTemplates (vlax-invoke-method dbConnect "GetLabelTemplates"))

  
  


;;; Get the linkTemplates     (setq lA_Obj_IDS NUL)
(setq LTs (vlax-invoke-method dbConnect "GetLinkTemplates"))
 
  (vlax-for  LT LTs
    
    (vlax-for thisLink (vlax-invoke-method dbConnect "GetLinks" LT nil nil nil)
      
      (setq l_Obj_ID (vlax-get-property thisLink "ObjectID"))
      
      
      (if (= l_Obj_ID ob_ID)
	
	(setq lA_Obj_IDS (CONS thisLink lA_Obj_IDS))
	
	)
      )
    )

(setq linkTemplate (CAR lA_Obj_IDS))
  (setq linkTemplatename (vlax-get-property (vlax-get-property linkTemplate "linkTemplate") "Name") ) 

   (setq thisKeyValue (vlax-invoke-method (vlax-get-property linkTemplate "KeyValues") "Item" 0) )
  
  (setq strKeyName (vlax-get-property thisKeyValue "FieldName"))
  (setq thisValue (vlax-variant-value (vlax-get-property thisKeyValue "Value")))
 

  

  
  
  
  
  
  


 (setq adoconnect nil)
  (setq ADOConnect (vlax-create-object "ADODB.Connection") )

   (cmdConnectDataSource_Click linkTemplate) 

 (setq Count  0
	cmd (vlax-create-object "ADODB.Command"))

  (vlax-put-property cmd "ActiveConnection" ADOConnect)
  (vlax-put-property cmd "CommandTimeout"  30)
  (vlax-put-property cmd "CommandText" (strcat"SELECT * from " 
					      (vlax-get-property (vlax-get-property linkTemplate "linkTemplate") "Table")))

  (setq rs nil)	
  (setq rs (vlax-create-object "ADODB.Recordset"))
  (vlax-invoke-method rs "OPEN" cmd nil adok-adOpenDynamic adok-adLockBatchOptimistic adok-adCmdUnknown)



  
  (princ (strcat "\n " (itoa (vlax-get-property rs "recordCount")) " Rows"))


 

  (princ (printFieldNames rs nil))
  
  (setq Values  (printFieldValues rs nil))

  (setq hh  0)
(repeat (length Values)

  
    (princ (nth hh Values))
    
  (princ  "\n")
  (princ  "\n")
  (setq hh  (+ 1 hh))
 )
  
  (princ  "\n")
  (princ  "\n")








  )


;;;
;;;  
;;;
;;;  (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
;;;  (vla-regen acDoc acAllViewports)
;;;
;;;  

  



  
       

















  



;;;--------------------------------------------------------------------;
;;; Connect to the datasource and table for this linkTemplate.         ;
;;; Display the ADODB Connection object's Version and Provider info.   ;
;;;--------------------------------------------------------------------;
(defun cmdConnectDataSource_Click( linkTemplate	; Pass in linkTemplate argument, or nil
				   /  strDataSourceLoc strDataSource
				     currConnectionString )

;;;  (if (null linkTemplate) (setq linkTemplate (getLinkTemplate)) )


  (setq strDataSourceLoc (strcat (vlax-get-property dbConnect "DataSourceLocation") "\\")
	strDataSource (vlax-get-property (vlax-get-property linkTemplate "linkTemplate") "DataSource") ) 


  (if adoConnect
      (if (= adok-adStateOpen (vlax-get-property ADOConnect "State"))
	  (vlax-invoke-method ADOConnect "Close")))
  (setq adoconnect nil)
  (setq ADOConnect (vlax-create-object "ADODB.Connection") ) ; ADOConnect is a global

  (setq currConnectionString (strcat "File Name=" strDataSourceLoc strDataSource 
				     ".udl;User ID=;Password=;" ))

  (vlax-put-property ADOConnect "ConnectionString" currConnectionString)
  (vlax-invoke-method ADOConnect "Open" currConnectionString "" "" -1) ; LISP seems to require args which should be optional... 


;;;  (if (= adok-adStateOpen (vlax-get-property ADOConnect "State"))
;;;      (alert (strcat strDataSource " is connected."
;;;		     "\nVersion = " (vlax-get-property ADOCOnnect "Version")
;;;		     " Provider = " (vlax-get-property ADOCOnnect "Provider")))
;;;    (alert (strcat "Unable to connect to " strDataSource))
;;;  )

  (setq status_string (strcat "ADODB.Connection.OPEN( " 
			      "File Name=" strDataSource 
			      ".udl;User ID=;Password=;" ))
)









;;;--------------------------------------------------------------------;
;;; printFieldNames() accepts an ADODB.RecordSet object and returns a  ;
;;; string containing the column names for this RecordSet's Fields.    ;
;;;--------------------------------------------------------------------;
(defun printFieldNames( rs bPrint / strColumnNames fields fieldsIndex thisField padStr
			   fieldsCount thisFieldDefinedSize thisFieldName )
  
  (setq strColumnNames ""
	padStr         "")

  (setq fields (vlax-get-property rs "Fields")
	fieldsCount (1- (vlax-get-property fields "Count")) ; zero-based index
	fieldsIndex 0)

  (while (&amp;lt;= fieldsIndex fieldsCount)
    (setq thisField (vlax-get-property fields "item" fieldsIndex)) ; Item is a property not a method for recordSet fields...
    (setq thisFieldDefinedSize (vlax-get-property thisField "DefinedSize")
	  thisFieldName (vlax-get-property thisField "Name"))

    
    (if (&amp;lt; fieldsIndex fieldsCount) ; Don't output final comma after last fieldname
	(setq strColumnNames (strcat strColumnNames thisFieldName ", "))
      (setq strColumnNames (strcat strColumnNames thisFieldName))
      )
    (setq fieldsIndex (1+ fieldsIndex))
    )

  ;; Print these field-names
    (if bPrint
	(princ (strcat "\n" strColumnNames "\n")))
  

  strColumnNames	; Return this value
)







;;;--------------------------------------------------------------------;
;;; Utility function which accepts an ADODB.RecordSet object and a boolean.
;;; Each record in the recordSet is converted to a list of strings.    ;
;;; This routine returns a list of these list-of-string records.       ;
;;;                                                                    ;
;;; Set 2nd arg, bPrint == T to print records to screen, otherwise nil ;
;;; to just return the recordset fields as a list-of-list-of-string.   ;
;;;--------------------------------------------------------------------;
(defun printFieldValues( rs bPrint / fields fieldsIndex thisField rowIndex lstAllRows
			    fieldsCount strFieldValue strOneRow thisValue )

  (while (not (equal :vlax-true (vlax-get-property rs "EOF")))
    
    (setq fields (vlax-get-property rs "Fields")
	  fieldsCount (1- (vlax-get-property fields "Count")) ; zero-based index
	  fieldsIndex 0
	  strOneRow nil)

    ;; Print out record count:
    ;;  (princ (setq (strcat "\nThere are " (vl-princ-to-string fieldsCount)  " fields:\n\n")))


    (while (&amp;lt;= fieldsIndex fieldsCount)
      (setq thisField (vlax-get-property fields "item" fieldsIndex)) ; Item is a property not a method for recordSet fields...
      (setq thisValue (vlax-variant-value (vlax-get-property thisField "Value")))
      
      (setq strFieldValue (vl-princ-to-string thisValue))
      
      (setq strOneRow (append strOneRow (list strFieldValue)))
      (if (&amp;lt; fieldsIndex fieldsCount ) ; Don't output final comma after last fieldname
	  (setq strOneRow (append strOneRow (list ", ")))
	)
      (setq fieldsIndex (1+ fieldsIndex))
     );_while fieldsIndex
    
    
    (setq lstAllRows (cons (apply 'strcat strOneRow) lstAllRows))

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; Display these field-names
    (if bPrint
	(progn
	  (princ (apply 'strcat strOneRow))
	  (princ "\n")
	)
    )
    
    (vlax-invoke-method rs "MoveNext") ; Move to next row in recordSet.
    
    );_while not yet at RecordSet EOF

  (setq lstAllRows (reverse lstAllRows)) ; Return this big list of all rows.
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="12m.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1193814iB6F7E08908C72EDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="12m.gif" alt="12m.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 04:02:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/11849428#M12199</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2023-03-27T04:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Link Template to Object Data</title>
      <link>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/12879175#M12200</link>
      <description>&lt;P&gt;I am still trying and I am getting closer. I managed to show the key field "INTERNO_DEMARCACION" but I still can't show the corresponding field "CLASE DEMARCACION", I am still working on transferring these values in the object data, thank you for any help.&lt;BR /&gt;&lt;BR /&gt;I share the code I am working on:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:LTOD (/ acad doc ss obj linkTemplates dbConnect gCmnFiles gCaoTlb gADO-DLLpath linkTemplate)
  (vl-load-com)

  ;; Obtener el objeto de AutoCAD y el documento activo
  (setq acad (vlax-get-acad-object))
  (setq doc (vla-get-ActiveDocument acad))

  ;; Ruta de las bibliotecas necesarias
  (setq gCmnFiles (getenv "COMMONPROGRAMFILES") 
        gCaoTlb (strcat gCmnFiles "\\AUTODESK SHARED\\" "cao20enu.tlb")
        gADO-DLLpath (strcat gCmnFiles "\\system\\ado\\msado15.dll"))

  ;; Verificar la existencia de la biblioteca ADO
  (if (null (findfile gADO-DLLpath))
    (progn
      (alert (strcat "Could not load ADO type library from: " gADO-DLLpath)) 
      (exit)
    )
  )

  ;; Importar la biblioteca de tipos ADO
  (if (null adok-adStateOpen)  ;; Verificar que la biblioteca de tipos ADO no se haya cargado aún
    (vlax-import-type-library :tlb-filename gADO-DLLpath
                              :methods-prefix "adom-"
                              :properties-prefix "adop-"
                              :constants-prefix "adok-"))

  ;; Importar la biblioteca de tipos CAO
  (if (null caom-GetLinkTemplates)  ;; Verificar que la biblioteca de tipos CAO no se haya cargado aún
    (vlax-import-type-library :tlb-filename gCaoTlb
                              :methods-prefix "caom-"
                              :properties-prefix "caop-"
                              :constants-prefix "caok-"))
							  
  ;; Obtener el objeto y su ID
  (setq ent1 (car (entsel "\nSelect entity ")))
  (setq Obj (vlax-ename-&amp;gt;vla-object ent1))
  (setq ob_ID (vla-get-objectid Obj))

  ;; Crear el objeto DbConnect
  (setq dbConnect (vlax-create-object "CAO.DbConnect.20"))

  ;; Obtener los link templates
  (setq linkTemplates (vlax-invoke-method dbConnect "GetLinkTemplates"))

  (vlax-for LT linkTemplates
    (vlax-for thisLink (vlax-invoke-method dbConnect "GetLinks" LT nil nil nil)
      (setq l_Obj_ID (vlax-get-property thisLink "ObjectID"))
      (if (= l_Obj_ID ob_ID)
        (setq lA_Obj_IDS (cons thisLink lA_Obj_IDS))
      )
    )
  )

  (setq linkTemplate (car lA_Obj_IDS))
  (setq linkTemplatename (vlax-get-property (vlax-get-property linkTemplate "LinkTemplate") "Name"))

  ;; Obtener valor de INTERNO_DEMARCACION desde el link template
  (setq thisKeyValue (vlax-invoke-method (vlax-get-property linkTemplate "KeyValues") "Item" 0))
  (setq strKeyName (vlax-get-property thisKeyValue "FieldName"))
  (setq thisValue (vlax-variant-value (vlax-get-property thisKeyValue "Value")))

  ;; Conectar a la fuente de datos
  (defun cmdConnectDataSource_Click (linkTemplate / strDataSourceLoc strDataSource currConnectionString)
    (setq strDataSourceLoc (strcat (vlax-get-property dbConnect "DataSourceLocation") "\\")
          strDataSource (vlax-get-property (vlax-get-property linkTemplate "LinkTemplate") "DataSource"))
    (if adoConnect
      (if (= adok-adStateOpen (vlax-get-property ADOConnect "State"))
          (vlax-invoke-method ADOConnect "Close")))
    (setq adoconnect nil)
    (setq ADOConnect (vlax-create-object "ADODB.Connection"))
    (setq currConnectionString (strcat "File Name=" strDataSourceLoc strDataSource ".udl;User ID=;Password=;"))
    (vlax-put-property ADOConnect "ConnectionString" currConnectionString)
    (vlax-invoke-method ADOConnect "Open" currConnectionString "" "" -1)
  )
  
  (cmdConnectDataSource_Click linkTemplate)

  ;; Preparar el comando ADO
  (setq cmd (vlax-create-object "ADODB.Command"))
  (vlax-put-property cmd "ActiveConnection" ADOConnect)
  (vlax-put-property cmd "CommandTimeout" 30)
  (vlax-put-property cmd "CommandText" (strcat "SELECT * FROM " (vlax-get-property (vlax-get-property linkTemplate "LinkTemplate") "Table")))
  
  ;; Abrir el Recordset
  (setq rs (vlax-create-object "ADODB.Recordset"))
  (vlax-invoke-method rs "Open" cmd nil adok-adOpenDynamic adok-adLockBatchOptimistic adok-adCmdUnknown)

  ;; Buscar la fila correspondiente a INTERNO_DEMARCACION
  (vlax-invoke-method rs "MoveFirst")
  (setq found nil)
  (while (and (not (vlax-get-property rs "EOF")) (not found))
    (setq fields (vlax-get-property rs "Fields"))
    (setq fieldInterno (vlax-invoke-method fields "Item" 0))
    (setq internoValue (vlax-variant-value (vlax-get-property fieldInterno "Value")))
    (if (= thisValue internoValue)
      (setq found t)
      (vlax-invoke-method rs "MoveNext"))
  )
  
  (if found
    (progn
      ;; Obtener el valor de CLASE_DEMARCACION
      (setq fieldClase (vlax-invoke-method fields "Item" 1))
      (setq claseValue (vlax-variant-value (vlax-get-property fieldClase "Value")))
    )
    (setq claseValue "No encontrado")
  )

  ;; Copiar los valores a Object Data
  (setq tn "SDM_DEM_DEMARCACION")                
  (ade_odaddrecord tn)
  (ade_odsetfield ent1 tn "INTERNO_DEMARCACION" (vl-princ-to-string thisValue))
  (ade_odsetfield ent1 tn "CLASE_DEMARCACION" (vl-princ-to-string claseValue))

  ;; Mostrar resultados
  (princ (strcat "\n" (itoa (vlax-get-property rs "RecordCount")) " Rows\n"))
  (princ (strcat "INTERNO_DEMARCACION: " (vl-princ-to-string thisValue) "\n"))
  (princ (strcat "CLASE_DEMARCACION: " (vl-princ-to-string claseValue) "\n"))

  (princ)
)

&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 04 Jul 2024 22:30:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transfer-link-template-to-object-data/m-p/12879175#M12200</guid>
      <dc:creator>BriamR</dc:creator>
      <dc:date>2024-07-04T22:30:35Z</dc:date>
    </item>
  </channel>
</rss>

