08.09.2007 21:42    

doruk
arkadaşlar kolay gelsin
oluşturduğumuz blokları silebilmek mümkünmü ve nasıl?:blush

08.09.2007 21:58    

ehya
Silmek derken nasıl silmek???
Erase komutu ile sil gitsin.

09.09.2007 10:05    

t-rex
silmek istediğin bloğun içindeki bir kısımsa yani parçası ise block editor den işlem yapacan block seçip üzerinde değişiklik veya silme işlemini yapabilrsin.
kolay gelsin.....

05.10.2007 21:24    

doruk
hayır arkadaşlar
bloğu blok insort yaptığında bile var olmadığını görmek istiyorum yani sadece dosyadaki görünür bloğu değilde
blok bankasındaki yerinide yok edebiliyormuyuz?
bilmem anlata bildimmi?...

05.10.2007 21:28    

ehya
Eğer dosya içerisinde bloğu insert edip, patlatmadıysanız bloğun ismi veritabanında kayıtlı olacaktır ve bu isim silenemez.
Silinmesi için o bloğun dosya içerisinde olmaması lazım.
Insert ettikten sonra bloğu patlatın ve purge komutu ile gereksiz tüm listeleri temizleyin..

12.01.2011 09:41    

pno
ehya harikasın teşşekkürler

05.09.2011 08:11    

tugbam_23
Aynı sorun bendede var mesela lavabo diye bir blok oluşturdum. ama insert ettiğim zaman eski bir çizim geliyor ve bu blok silinmiyor. dosya içinde öyle bir çizim yok ne yapmalıyım nasıl silinir.

05.09.2011 10:31    

ProhibiT
Lavabo isimli çizim xref ile insert edilmişse, insert edilen obje silinse bile xref listesinde lavabo kalacağından ve purge ile bu external reference temizlenemeyeceğinden bahsettiğiniz durum ortaya çıkıyor olabilir.

autocad komut satırından xref girin açılan pencerede ilgili referansın (mesela lavabo) üzerine sağ tıklayıp, açılan menüden "detach" seçin. bundan sonra block'unuzu yeniden tanımlayın...

kolay gelsin.

05.09.2011 10:50    

tugbam_23
Teşekkür ederim ilginiz için ama olmadı xref yazdığım zaman sadece tabloda çizimin adı çıktı. birde ben w enter (write blok) yaparak bloklarımı yapıyorum. b enter (blok definition) ile blok yapma arasındaki fark nedir. b enter yapınca name kısmında çıkan bütün blokları silmek istiyorum içinden çıkamadım bi türlü. purge ile siliyorum başka bir çizimde gene önüme çıkıyolar ne yapmalıyım :dozingoff

05.09.2011 11:57    

ehya
wblock : Dosya içerisinde seçilen nesnelerin ayrı bir dwg dosyası olmasını sağlar. blok nesnesi değildir.
Block : Dosya içerisinde seçilen nesnelerin blok nesnesine dönüştürülmesini sağlar. bu nesneler tek bir nesne gibi hareket edecek olup bazı özelliklere sahiptir.

block komutu ile hazırlanan nesneler sadece o dosya için geçerlidir. Başka bir dosyada kullanılması için DesignCenter komutu gibi gelişmiş komutlar kullanılır. bir dosyada mevcut blokları temizlediğinizde başka dosyada da temizlenmez. bu temizleme işlemi sadece mevcut dosya için geçerlidir. tüm dosyalarda otomatik olarak temizlenmesi mümkün değildir. Bir bloğun dosyadan temizlenebilmesi için öncelikle şart, o bloğun dosya içerisinde kullanılmaması gerekir.

tüm dosyalarda çıkmamasını engellemek için önerim, kullandığınız referans çizim dosyasınız temiz bir hale getirmeniz ve bundan sonraki tüm çizimlerinizde bu referans dosyasını kullanmanızdır...

05.09.2011 12:31    

tugbam_23
Anladım çok teşekkür ederim dediğiniz gibi yeni bir çizim oluşturmak en mantıklısı çok sağolun

24.02.2018 13:02    

stak
geç bir cevap oldu ama birilerinin işine yarayabilir diye yazıyorum. Purge ile temizlenebilir. Ama bazen o da işe yaramıyor. O zaman sadece kullanmak istediğiniz blocku wblock ile dışarı aktarıp diğer gereksiz tüm blocklardan kurtulabilirsiniz. sonra bu dosyayı diğerine insert etmek yerine, wblock dosyasının içine ana çizimi insert etmek sorununuzu çözebilir.

05.05.2022 08:19    

halilozcakir
Merhaba silmek istediğimiz blok başka blokların içine gömülü ise nasıl sileriz acaba örneğin şu sıralar cephe mimarisi ile başım dertte camların kapıların içinde kendi profilleri blok , camlar dinamik güzel de vida, fitil ,silikon ,conta vb var bunları blok isimleri belli isimden silemez miyiz.? Yada layerdan filtre ederek

halilozcakir (05.05.2022 08:44 GMT)

11.02.2023 07:32    

baha07
Alıntı
halilozcakir :
Merhaba silmek istediğimiz blok başka blokların içine gömülü ise nasıl sileriz acaba örneğin şu sıralar cephe mimarisi ile başım dertte camların kapıların içinde kendi profilleri blok , camlar dinamik güzel de vida, fitil ,silikon ,conta vb var bunları blok isimleri belli isimden silemez miyiz.? Yada layerdan filtre ederek


ic ice bloklar silinirken , evet siliyor fakat yanlislikla yanlis blok ismini silerseniz . ctrl+z geri alsaniz bile ic ice bloktaki blok geri gelmiyor . dikkatli kullanilmasi gerekiyor .

Kod:

;;-------------------------=={ Delete Blocks }==------------------------;;
;;  Cizimdeki bloklari  siler                                           ;;
;;  blocklar lisp calistikdan sonra Ekrandan secilebilir yada           ;;
;; (N) ile  listeden silin                                              ;;
;;  silinen nesneler  hem ekrandan hem block editorunden silinir        ;;
;;                                                                      ;;
;;  This program enables the user to quickly remove multiple blocks     ;;
;;  from a drawing.                                                     ;;
;;                                                                      ;;
;;  After invoking the program with the command 'delblocks' at the      ;;
;;  AutoCAD command-line, the user is prompted to select a block to     ;;
;;  delete. At this prompt, the user may either select a block          ;;
;;  reference from the drawing, type 'N' to choose a block by name, or  ;;
;;  exit the program by typing 'E' or by dismissing the prompt.         ;;
;;                                                                      ;;
;;  By opting to choose a block by name, the user is presented with a   ;;
;;  simple dialog interface consisting of a list box and filter. The    ;;
;;  dialog provides a list of all standard & dynamic blocks defined     ;;
;;  in the active drawing, excluding anonymous blocks and xrefs. From   ;;
;;  this list, the user may select multiple blocks to be deleted from   ;;
;;  the active drawing.                                                 ;;
;;                                                                      ;;
;;  Upon the user selecting a block from the drawing or selecting one   ;;
;;  or more block names from the dialog, the program will delete all    ;;
;;  primary & nested references of the blocks from all layouts of the   ;;
;;  active drawing, and will proceed to delete the respective block     ;;
;;  definitions, if possible.                                           ;;
;;                                                                      ;;
;;  The user will be informed at the command-line of those blocks       ;;
;;  successfully deleted by the program, and those blocks that the      ;;
;;  program was unable to remove.                                       ;;
;;                                                                      ;;
;;  The program also defines the function 'LM:deleteblocks' so that     ;;
;;  users who wish to remove multiple blocks from several drawings      ;;
;;  in a batch processing operation may bypass the dialog and call      ;;
;;  this function with a VLA Document Object and a list of block names  ;;
;;  (case-insensitive) from a Script or another LISP application.       ;;
;;  This function is also compatible with ObjectDBX.                    ;;
;;----------------------------------------------------------------------;;
;;  Author:  Lee Mac, Copyright © 2012  -  www.lee-mac.com              ;;
;;----------------------------------------------------------------------;;
;;  Version 1.0    -    2012-07-14                                      ;;
;;                                                                      ;;
;;  - First release.                                                    ;;
;;----------------------------------------------------------------------;;
;;  Version 1.1    -    2016-11-05                                      ;;
;;                                                                      ;;
;;  - Program modified to prompt user for selection of a block to       ;;
;;    delete, with the option of displaying a list of all blocks        ;;
;;    defined in the drawing.                                           ;;
;;----------------------------------------------------------------------;;
(defun c:delblocks ( / *error* def lst sel tmp )
    (defun *error* ( msg )
        (LM:endundo (LM:acdoc))
        (if (not (wcmatch (strcase msg) "*break,*cancel*,*exit*"))
            (princ (strcat "\nError: " msg))
        )
        (princ)
    )
    (while (setq def (tblnext "block" (not def)))
        (if (zerop (logand 125 (cdr (assoc 70 def))))
            (setq lst (cons (cdr (assoc 2 def)) lst))
        )
    )
    (setq lst (vl-sort lst '<))
    (while
        (and (or lst (prompt "\nNo blocks defined in the current drawing."))
            (progn
                (setvar 'errno 0)
                (initget "Name Exit")
                (setq sel (entsel "\nSelect block to delete [Name/Exit] <Exit>: "))
                (cond
                    (   (= 7 (getvar 'errno))
                        (princ "\nMissed, try again.")
                    )
                    (   (or (null sel) (= "Exit" sel))
                        nil
                    )
                    (   (= "Name" sel)
                        (if (setq tmp (LM:filtlistbox "Select Blocks to Delete" lst t))
                            (setq tmp (LM:deleteblocks:acdoc tmp)
                                  lst (vl-remove-if '(lambda ( x ) (member (strcase x) tmp)) lst)
                            )
                        )
                        nil
                    )
                    (   (/= "INSERT" (cdr (assoc 0 (entget (car sel)))))
                        (princ "\nThe selected object is not a block.")
                    )
                    (   t
                        (setq tmp (LM:deleteblocks:acdoc (list (LM:blockname (vlax-ename->vla-object (car sel)))))
                              lst (vl-remove-if '(lambda ( x ) (member (strcase x) tmp)) lst)
                        )
                        t
                    )
                )
            )
        )
    )
    (princ)
)
(defun LM:deleteblocks:acdoc ( del / rtn )
    (LM:startundo (LM:acdoc))
    (setq rtn (LM:deleteblocks (LM:acdoc) del))
    (vla-regen (LM:acdoc) acallviewports)
    (foreach blk del
        (if (member (strcase blk) rtn)
            (princ (strcat "\nDeleted block " blk "."))
            (princ (strcat "\nUnable to delete block " blk "."))
        )
    )
    (LM:endundo (LM:acdoc))
    rtn
)
;; Delete Blocks  -  Lee Mac
;; Deletes all references of a list of blocks from a drawing (including nested references, nested to any level).
;; Proceeds to delete the associated block definitions from the drawing, if possible.
;; doc - [vla] Document object
;; lst - [lst] List of block names (case insensitive)
;; Returns: [lst] List of blocks that were successfully deleted.
(defun LM:deleteblocks ( doc lst / blc lck )
    (setq blc (vla-get-blocks doc))
    (if (setq lst (mapcar 'strcase (vl-remove-if-not '(lambda ( blk ) (LM:catchapply 'vla-item (list blc blk))) lst)))
        (progn
            (vlax-for lay (vla-get-layers doc)
                (if (= :vlax-true (vla-get-lock lay))
                    (progn
                        (setq lck (cons lay lck))
                        (vla-put-lock lay :vlax-false)
                    )
                )
            )
            (vlax-for def blc
                (vlax-for obj def
                    (if (and (= "AcDbBlockReference" (vla-get-objectname obj))
                             (member (strcase (LM:blockname obj)) lst)
                        )
                        (vl-catch-all-apply 'vla-delete (list obj))
                    )
                )
            )
            (setq lst (vl-remove-if-not '(lambda ( blk ) (LM:catchapply 'vla-delete (list (vla-item blc blk)))) lst))
            (foreach lay lck (vla-put-lock lay :vlax-true))
            lst
        )
    )
)
;; Catch Apply  -  Lee Mac
;; Applies a function to a list of parameters and catches any exceptions.
(defun LM:catchapply ( fnc prm / rtn )
    (if (not (vl-catch-all-error-p (setq rtn (vl-catch-all-apply fnc prm))))
        (cond ( rtn ) ( t ))
    )
)
;; Filtered List Box  -  Lee Mac
;; Displays a list box interface from which the user may select one or more items.
;; Includes an edit box filter to enable the user to filter the displayed list of items.
;; msg - [str] List box dialog title
;; lst - [lst] List of strings to display in the list box
;; mtp - [bol] T=Allow multiple items; nil=Single item selection
;; Returns: [lst] List of selected items, else nil
(defun LM:filtlistbox ( msg lst mtp / _addlist dch dcl des rtn sel tmp )
    (defun _addlist ( key lst )
        (start_list key)
        (foreach x lst (add_list x))
        (end_list)
        lst
    )
    (if
        (and
            (setq dcl (vl-filename-mktemp nil nil ".dcl"))
            (setq des (open dcl "w"))
            (write-line
                (strcat
                    "filtlistbox : dialog { label = "" msg ""; spacer;"
                    ": list_box { key = "lst"; width = 50; fixed_width = true; height = 15; fixed_height = true; allow_accept = true; "
                    "multiple_select = " (if mtp "true" "false") "; }"
                    ": edit_box { key = "flt"; width = 50; fixed_width = true; label = "Filter:"; }"
                    "spacer; ok_cancel; }"
                )
                des
            )
            (not (close des))
            (< 0 (setq dch (load_dialog dcl)))
            (new_dialog "filtlistbox" dch)
        )
        (progn
            (_addlist "lst" (setq tmp lst))
            (set_tile "lst" (setq rtn "0"))
            (set_tile "flt" "*")
            (action_tile "lst" "(setq rtn $value)")
            (action_tile "flt"
                (vl-prin1-to-string
                   '(progn
                        (setq flt (strcat "*" (strcase $value) "*")
                              sel (mapcar '(lambda ( n ) (nth n tmp)) (read (strcat "(" rtn ")")))
                        )
                        (_addlist "lst" (setq tmp (vl-remove-if-not '(lambda ( x ) (wcmatch (strcase x) flt)) lst)))
                        (set_tile "lst"
                            (setq rtn
                                (vl-string-trim "()"
                                    (vl-princ-to-string
                                        (cond
                                            (   (vl-sort (vl-remove nil (mapcar '(lambda ( x ) (vl-position x tmp)) sel)) '<))
                                            (  '(0)   )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
            (setq rtn
                (if (= 1 (start_dialog))
                    (mapcar '(lambda ( x ) (nth x tmp)) (read (strcat "(" rtn ")")))
                )
            )
        )
    )
    (if (< 0 dch)
        (setq dch (unload_dialog dch))
    )
    (if (and (= 'str (type dcl)) (findfile dcl))
        (vl-file-delete dcl)
    )
    rtn
)
;; Block Name  -  Lee Mac
;; Returns the true (effective) name of a supplied block reference
(defun LM:blockname ( obj )
    (if (vlax-property-available-p obj 'effectivename)
        (defun LM:blockname ( obj ) (vla-get-effectivename obj))
        (defun LM:blockname ( obj ) (vla-get-name obj))
    )
    (LM:blockname obj)
)
;; Start Undo  -  Lee Mac
;; Opens an Undo Group.
(defun LM:startundo ( doc )
    (LM:endundo doc)
    (vla-startundomark doc)
)
;; End Undo  -  Lee Mac
;; Closes an Undo Group.
(defun LM:endundo ( doc )
    (while (= 8 (logand 8 (getvar 'undoctl)))
        (vla-endundomark doc)
    )
)
;; Active Document  -  Lee Mac
;; Returns a global pointer to the VLA Active Document Object
(defun LM:acdoc nil
    (cond ( acdoc ) ((setq acdoc (vla-get-activedocument (vlax-get-acad-object)))))
)
;;----------------------------------------------------------------------;;
(vl-load-com) (princ)
;;----------------------------------------------------------------------;;
;;                             End of File                              ;;
;;----------------------------------------------------------------------;;

baha07 (11.02.2023 09:23 GMT)

> 1 <
Copyright © 2004-2022 SQL: 8.141 saniye - Sorgu: 81 - Ortalama: 0.1005 saniye