Jump to content

Need LISP to Unload all XREF


Faouweb

Recommended Posts

Posted

Hi,

Is there any LISP to Unload all XREF?

Thank you.

Posted
(vlax-for block (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
 (if (= (vla-get-isxref block) :vlax-true) (vla-unload block))
 )

Posted

How can I use it?

I have tried to defun c: TEST () ; and I have put the code but it doesn't work.

I am not a specialist of AutoLISP :?

Thank you.

Posted

Sorry.. Try this

(defun c:test nil (vl-load-com)
  (vlax-for block (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))  
    (if (= (vla-get-isxref block) :vlax-true) (vla-unload block))
 )
)

Posted

Thank you Stefan BMR :)

I have found this also:

 


(defun c:XDetach (/ blk)  (while   (setq blk (tblnext "block" (not blk)))   (if (and (cdr (assoc 1 blk))            (< (cdr (assoc 70 blk)) 32))     (command "_-xref" "_d" (cdr (assoc 2 blk))))  ) )

  • 1 month later...
Posted

one I found

 

xu.lsp

 

 

 

(defun C:Xu ( / )
(command "-xref" "u" "*")
(princ)
)

Posted
one I found

 

[ATTACH]51388[/ATTACH]

 

 

 

(defun C:Xu ( / )
(command "-xref" "u" "*")
(princ)
)

 

(command "-xref" "u" "*") what does "*" this do ? and where else we can use "*" this.

Posted

It means ALL or ANY. It is a wildcard search or selection symbol. It can be used pretty much anywhere you want to find or select ALL.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...