Author Topic: DATALINK  (Read 3001 times)

0 Members and 1 Guest are viewing this topic.

Harrie

  • Guest
DATALINK
« on: January 14, 2008, 12:53:12 PM »
A datalink is a Named Objects Dictionary in AutoCAD.
Is it possible that you make that with Visual Lisp, and can you
put the data from a data link with Visual Lisp in an ACAD_TABLE.

I get no help with the program GETCELL for the Cellvalues

Code: [Select]
(defun c:getcell( / oke tbe tbl rows clmns r c)
(vl-load-com)
(setq oke nil r -1 c -1)
(while (not oke)
(setq tbe (car (entsel "Please choose an TABLE: ")))
(if (= (cdr (assoc 0 (entget tbe))) "ACAD_TABLE")
(setq oke T))
)
(setq tbl (vlax-ename->vla-object tbe))
(setq rows (vla-get-Rows tbl))
(setq clmns (Vla-get-Columns tbl))
(while (not (and (>= r 0) (< r rows)))
(setq r (getint (strcat "\nEnter the row (0<= R >=" (itoa (- rows 1)) "):")))
)
(while (not (and (>= c 0) (< c clmns)))
(setq c (getint (strcat "\nEnter the column (0<= C >=" (itoa (- clmns 1)) "):")))
)
(vla-gettext tbl r c)
)

Regards

HofCAD

  • Guest
Re: DATALINK
« Reply #1 on: January 14, 2008, 01:52:42 PM »
I get with NDALA

Code: [Select]
(defun C:NDALA (/ adoc Datdict clsname keyname newstyleobj)
  (vl-load-com)
  (or adoc
      (setq adoc
        (vla-get-activedocument
          (vlax-get-acad-object)
        )
      )
  )
  (setq  Datdict
    (vla-item
      (vla-get-dictionaries
        (vla-get-database adoc)
      )
      "ACAD_DATALINK"
    )
  )
;(vlax-dump-object Datdict T)
 (setq   keyname "NewStyle"
  clsname  "AcDbDataLink"
  )
  (setq   newstyleobj
 (vlax-invoke Datdict 'Addobject keyname clsname)
  )
(princ)
)

Error: AutoCAD.Application: AcRxClassName entry is not in the system registry

« Last Edit: January 14, 2008, 01:56:59 PM by HofCAD »