+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Super Member
    Using
    Architectural DT 2007
    Join Date
    Dec 2002
    Location
    London
    Posts
    1,087

    Default Unbinding XREF's

    Anyone ever worked out how to unbind a drawing once its been binded to a drawing?Not that I've done it myself ,but if one day I ever do .The XREF becomes a block so isnt it just a case of delete the block and purge?

  2. #2
    vizwhiz
    Guest

    Default i be ya anything

    hi There Hyposmurf

    This is an interesting Thing to do

    i bet anything that fuccaro could write a LISP routine

    that would grab the name of the xref
    (assoc 0 = entity) (assoc 2 = name)

    find the insertion point
    (assoc 10 ? = insert point)

    get the rotation numerical value
    (assoc 40 = rotation)

    you could then:

    select the xref-bind block,
    delete,
    purge,
    re-xref, with the name-of-the-xref,
    insertion point,
    rotation angle

    This should be possible

    it is now 3:53 am so i hope This is still possible later in The Day when i actually
    wake up. i guess i am sleep-typing at the present moment. dont wake me yet.

    Thanks

    Randy

  3. #3
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,543

    Default

    I am not sure I understand the question. You may delete an XREF from the current drawing just like any other objects using the ERASE command. The XREF MANAGER will let you to detach the unused references.
    Vizwhiz you are talking about the reinsertion of the XREF -I must admit, I can not follow you.
    The DXF code for the rotation is 50, but this should not disturb your dreams.
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  4. #4
    Super Member
    Using
    Architectural DT 2007
    Join Date
    Dec 2002
    Location
    London
    Posts
    1,087

    Default

    What I meant Fuccaro was say you were working on a drawing and inserted a XREF,you then thought the drawing was either finished or that you no longer required the XREF to be an XREF.You would therefore bind the XREF into the drawing and it would become a block.If say you wanted the bound XREF to become a XREF again,your only method would be to delete the block(previosly the XREF) and then reinsert the XREF again.Vizwhiz was suggesting a routine to speed the process up,which would be pretty helpful.It's a shame there isnt an unbind option in the XREF manager

  5. #5
    Super Moderator f700es's Avatar
    Computer Details
    f700es's Computer Details
    Operating System:
    Windows 7 Pro (W)/Windows 7 Home Premium (H)
    Computer:
    Lenovo ThinkStation D20 (W)/ Dell Inspiron 570 (H)
    Motherboard:
    Intel (W)/AMD (H)
    CPU:
    Intel Xeon E5503 (W)/AMD Athlon 2 X4 (H)
    RAM:
    4 GB DDR3 (W)/ 6GB DDR3 (H)
    Graphics:
    nVidia Quadro FX 580 (W)/nVidia GF GT430 (H)
    Primary Storage:
    500 GB HDD (W)/1 TB (H)
    Secondary Storage:
    Seagate FreeAgent Go 320gb
    Monitor:
    Samsung P2770HD 28" LCD and Samsung B2430 (W)/Dell 22" LCD (H)
    Discipline
    Facilities Mgmt
    f700es's Discipline Details
    Occupation
    Space Database Admin
    Discipline
    Facilities Mgmt
    Details
    Archibus Management
    Using
    AutoCAD 2013
    Join Date
    Sep 2002
    Location
    Winston-Salem, NC - USA
    Posts
    4,907

    Default

    Quote Originally Posted by hyposmurf
    What I meant Fuccaro was say you were working on a drawing and inserted a XREF,you then thought the drawing was either finished or that you no longer required the XREF to be an XREF.You would therefore bind the XREF into the drawing and it would become a block.If say you wanted the bound XREF to become a XREF again,your only method would be to delete the block(previosly the XREF) and then reinsert the XREF again.Vizwhiz was suggesting a routine to speed the process up,which would be pretty helpful.It's a shame there isnt an unbind option in the XREF manager
    Couldn't you just type "XREF", select the xref file and hit the bind button? Would this not be the same thing? I might be wrong on this.

    F7

    Please do not PM me with CAD questions. Post your question on the forum. Our users are the best out there and you'll get the best possible answer to your question.

    - http://f700es.deviantart.com/gallery/ -


  6. #6
    Super Member
    Using
    Architectural DT 2007
    Join Date
    Dec 2002
    Location
    London
    Posts
    1,087

    Default

    Thats not what I meant F7,I was hoping to be able to have a routine to change the block back to the XREF it was before after you have bound it.In my searching for it I found a lisp that works called BLOCKTOXREF.It also appears that this lips has been built into the CAD2K4 express tools!So I had it just didnt realise.For anyone who hasnt got CAD2K4 here's the lips you need.
    ;;; BlockToXref.LSP
    ;;; Convert Blocks to Xrefs
    ;;; By Jimmy Bergmark
    ;;; Copyright (C) 1997-2003 JTB World, All Rights Reserved
    ;;; Website: www.jtbworld.com / http://jtbworld.vze.com
    ;;; E-mail: info@jtbworld.com / jtbworld@hotmail.com
    ;;; 2000-04-03 - First release
    ;;; Supports nested blocks, multiple tabs
    ;;; Tested on AutoCAD 2000

    (defun c:btx () (c:BlockToXref))
    (defun c:BlockToXref (/ errexit undox
    olderr restore errexitA2k
    ss ss1 e1 ix path
    bsl bn bnl bl bt not_ok repl oldvport oldregenmode
    typ ed layer color ltype ang ins tab oldtab
    )
    (defun errexit (s)
    (princ "\nError: ")
    (princ s)
    (restore)
    )

    (defun undox ()
    (setq ss1 nil)
    (setq ss2 nil)
    (setvar "ctab" oldtab)
    (if (> oldcvport 1) (command "._mspace") (command "._pspace"))
    (setvar "cvport" oldcvport)
    (setvar "regenmode" oldregenmode)
    (command "._undo" "_E")
    (setvar "cmdecho" oldcmdecho)
    (setq *error* olderr)
    (princ)
    )

    (setq olderr *error*
    restore undox
    *error* errexit
    )
    (setq oldcmdecho (getvar "cmdecho"))
    (setq oldtab (getvar "ctab"))
    (setq oldcvport (getvar "cvport"))
    (setq oldregenmode (getvar "regenmode"))
    (setvar "cmdecho" 0)
    (setvar "regenmode" 0)
    (command "._UNDO" "_BE")
    (setq A2k (wcmatch (getvar "ACADVER") "15*"))
    (if (and A2k (/= (setq ss1 (ssget '((0 . "INSERT")))) nil))
    (progn
    (vl-load-com)
    (setq ix 0)
    (setq bsl nil) ; block selection list
    (setq bnl nil) ; unique block name list
    (repeat (sslength ss1)
    (setq e1 (ssname ss1 ix))
    (setq bn (cdr (assoc 2 (entget e1)))) ; block name
    (setq bl (tblsearch "block" bn)) ; block list bn
    (setq bt (cdr (assoc 70 bl))) ; block type
    (if (and (/= (logand bt 4) 4) (not (member bn bnl))) ; no xrefs and no duplicates
    (setq bnl (cons bn bnl))
    )
    (setq ix (1+ ix))
    ); end repeat

    (foreach bn bnl
    (setq ss1 (ssget "X" (list (cons 0 "INSERT") (cons 2 bn))))
    (setq ix 0)
    (repeat (sslength ss1)
    (setq e1 (ssname ss1 ix))
    (setq bsl (cons (entget e1) bsl))
    (setq ix (1+ ix))
    )
    ); end repeat

    (foreach bn bnl
    (setq not_ok T)
    (while not_ok
    (setq path (getfiled "Match the block to a file"
    (if (not path) (strcat (getvar "dwgprefix") bn) (strcat (vl-filename-directory path) "\\" bn))
    "dwg" 0))
    (if path
    (if (= (strcase (vl-filename-base path)) (strcase bn))
    (setq not_ok nil)
    (progn
    (initget 0 "Yes No")
    (setq repl (getkword "\nAssign a different name? [Yes/No] <No>: "))
    (if (not repl) (setq repl "Yes"))
    (if (= "Yes" repl)
    (setq not_ok nil)
    (setq not_ok T)
    )
    )
    )
    )
    (if (not not_ok)
    (progn
    (setq ss (ssget "X" (list (cons 0 "INSERT") (cons 2 bn))))
    (setq ix 0)
    (repeat (sslength ss)
    (setq ed (ssname ss ix))
    (setq tab (cdr (assoc 410 (entget ed))))
    (setvar "ctab" tab)
    (entdel ed)
    (setq ix (1+ ix))
    )
    (repeat 10
    (vl-cmdf "._purge" "_b" "*" "N")
    )
    (initget 0 "Overlay Attach")
    (setq repl (getkword "\nEnter an option [Overlay/Attach] <Attach>: "))
    (if (not repl) (setq repl "Attach"))
    (if (= "Attach" repl) (setq typ "_A") (setq typ "_O"))
    (setq ix 0)
    (repeat (length bsl)
    (setq ed (nth ix bsl))
    (if (= bn (cdr (assoc 2 ed)))
    (progn
    (setq layer (cdr (assoc 8 ed)))
    (setq color (cdr (assoc 62 ed)))
    (if (not color) (setq color "_ByLayer"))
    (setq ltype (cdr (assoc 6 ed)))
    (if (not ltype) (setq ltype "_ByLayer"))
    (setq ang (/ (* 180.0 (cdr (assoc 50 ed))) pi))
    (setq ins (cdr (assoc 10 ed)))
    (setq tab (cdr (assoc 410 ed)))
    (setvar "ctab" tab)
    (if (/= tab "Model") (command "._pspace"))
    (vl-cmdf "._xref" typ path "_X" (cdr (assoc 41 ed)) "_Y" (cdr (assoc 42 ed)) "_Z" (cdr (assoc 43 ed)) ins ang)
    (vl-cmdf "._change" "_L" "" "_P" "_C" color "_LA" layer "_LT" ltype "")
    )
    )
    (setq ix (1+ ix))
    )
    )
    )
    (if (= path nil) (setq not_ok nil))
    )
    )
    ); end progn
    ); end if
    (restore)
    )

  7. #7
    Jerry98vert
    Guest

    Default

    Registered forum members do not see this ad.

    Nice works great.

Bookmarks

Posting Permissions

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