Need help!! Saving X-ref Paths

Discussion in 'AutoCAD' started by KCCINC, May 14, 2004.

  1. KCCINC

    KCCINC Guest

    I need to write a script/Lisp Routine to Save paths for a number of projects (Which is a lot), to cut down the personal attention. Is there a way to get around specifying specific X-refs and making global change no matter what x-refs are loaded??

    Thanx
    Troy
     
    KCCINC, May 14, 2004
    #1
  2. KCCINC

    Walker Guest

    This gets the paths to XREF. You can hack it to set the path rather
    than to get the path. I hope this helps some.

    ;------------------------------------------------------------------------------
    ;GETXREF: Get external reference path
    ;------------------------------------------------------------------------------
    (defun GETXREF (/ ABLOCK ACTIVEDOC ITEM THEBLOCKS THELIST YESXREF)
    (vl-load-com)
    ;retrieve a reference to the Active Document
    (setq ACTIVEDOC (vla-get-activedocument (vlax-get-acad-object)))
    ;retrieve a reference to the blocks
    (setq THEBLOCKS (vla-get-blocks ACTIVEDOC))
    ;create an empty list
    (setq THELIST '())
    ;process each block
    (vlax-for ITEM THEBLOCKS

    ;check if it's an Xref
    (setq YESXREF (vlax-get-property ITEM 'ISXREF))
    ;if it is
    (if (= YESXREF :vlax-true)
    ;do the following
    (progn
    ;get the Xref name
    (setq ABLOCK (vlax-get-property ITEM 'NAME))
    ;store it in the list
    (setq THELIST (append (list ABLOCK) THELIST))
    ) ;progn
    ) ;if
    ) ;vlax-for
    ;print the list
    THELIST
    ) ;defun
     
    Walker, May 14, 2004
    #2
  3. You didn't mention AutoCAD versions, but starting with 2002 Extensions (2004
    base) there is the Reference Manager external application.

    --
    R. Robert Bell


    I need to write a script/Lisp Routine to Save paths for a number of projects
    (Which is a lot), to cut down the personal attention. Is there a way to get
    around specifying specific X-refs and making global change no matter what
    x-refs are loaded??

    Thanx
    Troy
     
    R. Robert Bell, May 14, 2004
    #3
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.