Author Topic: ActiveX methods to retrieve xref path info?  (Read 3403 times)

0 Members and 1 Guest are viewing this topic.

daron

  • Guest
ActiveX methods to retrieve xref path info?
« on: December 12, 2003, 06:03:57 PM »
Anybody know of a way? If not, is it possible with AutoLisp?

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
ActiveX methods to retrieve xref path info?
« Reply #1 on: December 12, 2003, 06:05:44 PM »
Code: [Select]
;;; FUNCTION
;;; returns an association list of xref name and path
;;; for all xrefs in Modelspace
;;; i.e. (("TOC-PAV" . "D:\\DRAWINGS_TEMP\\TOC-PAV.dwg"))
;;;
;;; ARGUMENTS
;;;
;;; USAGE
;;; (setq xrefpath (MST-GetXrefPath))
;;;
;;; PLATFORMS
;;; 2000+
;;;
;;; AUTHOR
;;; Copyright© 2003 Mark S. Thomas
;;; mark.thomas@theswamp.org
;;;
;;; VERSION
;;; 1.0 Sun May 04, 2003
(defun MST-GetXrefPath (/ ms xref-path)
  (vl-load-com)
  (setq ms
        (vla-get-modelspace
          (vla-get-activedocument
            (vlax-get-acad-object)
            )
          )
        )

  (vlax-for x ms
            (if
              (= (vla-get-objectname x) "AcDbBlockReference")
              (if
                (vlax-property-available-p x 'Path)
                (setq xref-path
                      (cons
                        (cons
                          (vla-get-name x)
                          (vla-get-path x)
                          )
                        xref-path
                        )
                      )
                ); if
              ); if
            (vlax-release-object x)
            )
  xref-path
  )

;;; Last change: 2003 Sep 12
;;; Timestamp: <MST-GetXrefPath.lsp Fri 2003/09/12 20:22:41  NED>
;;; vim:tw=78:ts=4:
TheSwamp.org  (serving the CAD community since 2003)

daron

  • Guest
ActiveX methods to retrieve xref path info?
« Reply #2 on: December 12, 2003, 06:37:49 PM »
Thanks Mark. I was trying to access them through the blocks collection. Oops.