How can I update a link template

Discussion in 'AutoCAD' started by Jim Claypool, Jul 30, 2004.

  1. Jim Claypool

    Jim Claypool Guest

    I posted this in the connectivity forum, but got no response. Does anyone
    have a solution to this either Lisp or VBA?
    With the following function, I can create a link template

    (defun CreateLT (db tbl ltnname catalog schema keylist)
    (vl-load-com)
    (setq pDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    ;get the DBConnect
    (setq dbConnect (vla-getinterfaceobject (vlax-get-acad-object)
    "CAO.DbConnect.16"))
    ;get the linktemplates
    (setq pLTs(vlax-invoke-method dbConnect "GetLinkTemplates" pDoc))
    ;prepare the keydescriptions
    (setq pKeyDescs (vla-GetInterfaceObject (vlax-get-acad-object)
    "CAO.KeyDescriptions.16"))
    (foreach x keylist
    (vlax-invoke-method pKeyDescs "ADD" x 1 nil nil)
    )
    ;create the link template
    (vlax-invoke-method pLTs "ADD" db catalog schema tbl ltname pKeyDescs)
    )

    With the folowing function I can delete a link template if it has no links
    (vlax-invoke-method pLTs "DELETE" ltname)

    Is there a function to edit the link template, say to change the catalog or
    schema? I know I can do it with MAPPROPSLT
    but I need a way to do it from a program.
     
    Jim Claypool, Jul 30, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.