Author Topic: How to retrieve Xrefs layers ?  (Read 1420 times)

0 Members and 1 Guest are viewing this topic.

Sebb77

  • Guest
How to retrieve Xrefs layers ?
« on: July 16, 2009, 02:33:09 PM »
Hi all, i'm writing a routine (with a reactor) that will fire at plot command. Some users just want to be warned if there are Xrefs on DEFPOINTS, and if any other layers are configured as "not plottable"....quite easy though i'm surprised by an issue i didn't see comin'.... How can you know on which layer is an Xref ?
See below the part of the code i try to get it... i tried everything i had in mind, see my last trial, retrieving the handle in order to use ASSOC 8....
Don't try this it does not work, since there is no ASSOC 8 in an XREF record....doesn't seem to have a layer property at all  :oops:  (at least everywhere i searched)
Thanks..

Code: [Select]
  (setq blocks (vla-get-blocks (vla-get-activedocument (vlax-get-Acad-Object))))
  (setq rList '())

  (vlax-for item blocks
    (if
  (= (vlax-get-property item 'isXref) :vlax-true)

      (setq rList (append rList
    (list
      (list (vlax-get-property item 'name)
    (vlax-get-property item 'Handle)
    )
      )
    )
    );setq rlist
      );if
    );vlax-for

  (if rlist
    (progn
      (foreach ref rlist
(if (= "defpoints" (assoc 8 (entget (handent (cadr ref)))))
  (setq defref (append defref ref))
  )
);foreach
      )
    );if

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: How to retrieve Xrefs layers ?
« Reply #1 on: July 16, 2009, 02:36:46 PM »
Could you not just make a Selection set of the XRefs, and shuffle through it?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How to retrieve Xrefs layers ?
« Reply #2 on: July 16, 2009, 02:39:30 PM »
You can use the code in the first post here:
[ http://www.theswamp.org/index.php?topic=28062.0 ]

The list will have the entity names of the inserted xrefs, that way you can tell what layers they are on.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Sebb77

  • Guest
Re: How to retrieve Xrefs layers ?
« Reply #3 on: July 16, 2009, 02:40:39 PM »
Thank you gents i'll look into it right now..