See the top rated post in this thread. Click here

Results 1 to 4 of 4

Thread: Detach Xref by Selecting

  1. #1
    Active Member
    Join Date
    2006-02
    Posts
    74
    Login to Give a bone
    0

    Default Detach Xref by Selecting

    I'd like to create a lisp routine to pick an xref and then use the -xref command to detach the selected xref. How do I 'get' the xref's name. I'm looking for something that works like getvar does with system variables.

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    1

    Default Re: Detach Xref by Selecting

    Here is one I use.

    Code:
    (defun c:xr-d(/ xr1 xr2 xr3 tx1 tb1)
    ; Select xref to detach.
    
    (if (setq xr1 (entsel "\nSelect xref to detach: "))
      (progn
        (setq xr2 (entget (car xr1)))
        (setq tx1 (cdr (assoc 0 xr2)))
        (if (= tx1 "INSERT")
          (progn
            (setq xr3 (cdr (assoc 2 xr2)))
            (setq tb1 (tblobjname "block" xr3))
            (if (equal (logand 4 (cdr (assoc 70 (entget tb1)))) 4)
              (command "-xref" "d" xr3)
              (prompt "\nNo External Reference selected")
            )
          )
          (prompt "\nNo External Reference selected")
        )
      )
    )
    (princ)
    )

  3. #3
    Active Member
    Join Date
    2006-02
    Posts
    74
    Login to Give a bone
    0

    Default Re: Detach Xref by Selecting

    Thank you, Tim.

    This is way over my head. I've got a lot to learn.

  4. #4
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Detach Xref by Selecting

    You're welcome. This one doesn't have to many parts, so it wouldn't be to hard to explain, so if you have any questions just ask.

Similar Threads

  1. Xref overlay without detach
    By cadprog in forum Dot Net API
    Replies: 0
    Last Post: 2008-11-04, 08:46 AM
  2. Unable to detach xref
    By michael.12445 in forum AutoCAD General
    Replies: 9
    Last Post: 2008-02-28, 01:19 PM
  3. Replies: 1
    Last Post: 2006-07-14, 04:40 PM
  4. Unable to detach a Xref
    By sherflor in forum AutoCAD General
    Replies: 6
    Last Post: 2006-03-09, 01:34 PM
  5. Cannot detach a xref
    By kleenhippie in forum AutoCAD General
    Replies: 2
    Last Post: 2005-08-24, 04:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •