Blocktoxref in multi file ?

Blocktoxref in multi file ?

Anonymous
Not applicable
1,555 Views
13 Replies
Message 1 of 14

Blocktoxref in multi file ?

Anonymous
Not applicable

Hi all,

 

I have a problem with a thousand dwg binded (not my draw). Now i mean use command "Blocktoxref". Do anyone have the way with multi file in multi folder Categories than one by one open dwg and use Blocktoxref" in express ?

 

Thanks for solution.

0 Likes
1,556 Views
13 Replies
Replies (13)
Message 2 of 14

danglar
Advocate
Advocate

Hi

 

Try this one.. it can halp you for binded xrefs

0 Likes
Message 3 of 14

Anonymous
Not applicable

HI apelbaum2014,

Thanks for repply.

your list not exactly what i mean.

 

I thinhk i need script or DBX for delete blk "test" in dwg then attach xref "test" to dwg.

If use script then file large size open long time. So i mean use DBX.

 

Can show me some example for DBX for xref attach ?

 

 

0 Likes
Message 4 of 14

Anonymous
Not applicable

Okey,

 

i like this "silence". So i must Thinking.

 

Then i found some code del_block and attachXref of Lee Macto fill lisp.

 

Here code attachxref:

;xref is str "D:\\Desktop\\Temp\\Xref.dwg"

;list_obj is (list X Y Z rotate) of blk

(defun attachxref_PS (doc xref list_obj / )
(vla-attachexternalreference (vla-get-paperspace doc) master
(vl-filename-base xref)
(vlax-3d-point '(0 0 0))
(car list_obj);1.
(cadr list_obj);1.
(caddr list_obj);1.
(cadddr list_obj);0.
:vlax-true
)
)

 

So i have a question: how can attach xref to PS when drawing active model space ? although i get PS to attach xref.

 

Thanks in advance.

0 Likes
Message 5 of 14

Anonymous
Not applicable

Ahhh,

 

fixed done. 

 

^_^

0 Likes
Message 6 of 14

danglar
Advocate
Advocate

Hi

                          

The first part of your problem can solve attached lisp (I mean to delete block from dwg and also from database of drawing)

 

I hope it's help you

Message 7 of 14

danglar
Advocate
Advocate

.. and for second part of your problem you can use this function (see attached dll)

 

^P^C(command "netload" "AutoWblock.dll") AutoWblock

0 Likes
Message 8 of 14

Anonymous
Not applicable

Hi apelbaum2014

 

you right,

 

so i change code to:

 

(LM:odbx '(lambda ( doc ) (LM:deleteblocks doc (list name))) lst t)

 

Thank you.

 

^_^

 

 

 

0 Likes
Message 9 of 14

Anonymous
Not applicable

Okey, but

 

Can your code call via ODBX ? because i mean write to multi drawing and i remember can not call command.

 

^P^C(command "netload" "AutoWblock.dll") AutoWblock

 

 

 

0 Likes
Message 10 of 14

danglar
Advocate
Advocate

.. in order to  write  it to multi drawing  use this code:

(defun C:exv ( / COUNT DIR FILENAME FILES SCRIPTNAME) ;works only with igal.lsp
 (if (setq dir (getfiled "Select the drawing directory:" "" "dwg" 0))
 (setq dir (vl-filename-directory dir))
 )
 (if dir
 (setq files (vl-directory-files dir "*.dwg" 1))
 )
 (if files
 (progn
 (setq scriptname (open "C:\\batch.scr" "w")
 count 0
 )
 (while (setq filename (nth count files))
 (setq filename (strcat dir "\\" filename))
 (write-line (strcat "_open \"" filename "\"") scriptname)
 ;(write-line "_zoom extents" scriptname)

 ;(write-line "_DWG-PURGE" scriptname)

 (write-line "zx" scriptname) ;;; HERE YOU CAN ATTACH YOUR FUNCTION!

 (write-line "_qsave" scriptname)
 (write-line "_close" scriptname)
 (setq count (1+ count))
 )
 (close scriptname)
 )
 )
 (princ)
 )
(c:exv)
(command "script" "C:\\batch.scr")
0 Likes
Message 11 of 14

Anonymous
Not applicable
Okey
I knew use script. But sometime error open file readonly and i checked have not anyone or other pc open it in server. Only my pc open. Can u point me ? Or fix this.

Thank u so much.
0 Likes
Message 12 of 14

danglar
Advocate
Advocate

it's curious, but this code working perfect for me..

anyway try to load your function to starup suite and than use only alias of it whithout loading lisp function at all

0 Likes
Message 13 of 14

Anonymous
Not applicable

Yep, i must use 2 way: script and DBX to know.

 

In some case use script faster, and some case lower DBX then i custome it. ^_^

 

Anyway, thank you so much for share. 😄

 

Heizzzz, okey, pause lisp, time-out. 

 

Now time for thesis of Master.

 

 

0 Likes
Message 14 of 14

Anonymous
Not applicable

Hello Pony,

 

Can you please share the working version of the lisp routine that unbound xrefs and can run on multiple drawings.

 

Thank you,

 

Nasr

0 Likes