TuttoCAD Forum

TuttoCAD Forum
[ Home | Registrati | Discussioni Attive | Discussioni Recenti | Segnalibro | Msg privati | Sondaggi Attivi | Utenti | Album Fotografico | Download | | Cerca | FAQ ]
Nome Utente:
Password:
Salva Password
Password Dimenticata?

 Tutti i Forum
 1 - TuttoCAD Software
 AutoLISP
 Eliminare dati estesi
 Nuova Discussione  Rispondi
 Versione Stampabile Bookmark this Topic Aggiungi Segnalibro
I seguenti utenti stanno leggendo questo Forum Qui c'è:
Autore Discussione Precedente Discussione Discussione Successiva  

arri
Utente Master


Regione: Lombardia


14951 Messaggi

Inserito il - 09 novembre 2010 : 12:16:28  Mostra Profilo Invia a arri un Messaggio Privato  Rispondi Quotando
purtroppo il lisp del link non elimina i dati estesi di entità nidificate

; Marc'Antonio Alessi - http://xoomer.virgilio.it/alessi
; Function: ALE_DelXdataSs
;
; Version 1.01 - 08/04/2003
; Version 1.02 - 31/05/2006
;
; Description:
; delete XData of specified APPID(s)
;
; Arguments:
; BitFlg = 1 prompts ON
; BitFlg = 2 erase Xdata on all objects
;
; Use:
; (ALE_DelXdataSs '("MyApp1" "MyApp2") 1)
; delete by AppID's and by selection
; or
; (ALE_DelXdataSs '("*") 3)
; delete all AppID's from all objects
;
; Comments:
; The filter in ssget is not useful, because in case of a block with
; Attribute Xdata only, it doesn't work.
; The argument of the function should be a list. This allows you to
; delete Xdata's with different AppID's.
;
(defun ALE_DelXdataSs (ApsLst BitFlg / SsXdat ApsStr EntNam Countr)
(setq ApsStr "")
(foreach AppNam ApsLst
(setq ApsStr (strcat ApsStr "," AppNam))
)
(if (= 2 (logand 2 BitFlg))
(setq SsXdat (ssget "_X" (list (list -3 (list (substr ApsStr 2))))))
(setq SsXdat (ssget (list (list -3 (list (substr ApsStr 2))))))
)
(cond
( SsXdat
(repeat (setq Countr (sslength SsXdat))
(setq
Countr (1- Countr)
EntNam (ssname SsXdat Countr)
EntDat (entget EntNam ApsLst)
)
(ALE_DelXdataEnt EntNam EntDat)
(and
(= "INSERT" (DXF 0 EntDat))
(= 1 (DXF 66 EntDat))
(while
(=
"ATTRIB"
(DXF 0
(setq EntDat (entget (setq EntNam (entnext EntNam)) ApsLst))
)
)
(ALE_DelXdataEnt EntNam EntDat)
)
)
);repeat
(and (= 1 (logand 1 BitFlg)) (princ "\nEliminazione Xdata eseguita. "))
)
( (= 1 (logand 1 BitFlg)) (princ "\nNon è stato trovato nessun oggetto con
Xdata. ") )
)
)
;
; Use:
; (ALE_DelXdataEnt ename '("MyApp1" "MyApp2"))
;
(defun ALE_DelXdataEnt (EntNam EntDat / EntDat TmpLst)
(foreach ForElm (DXF -3 EntDat)
(setq TmpLst (cons (list (car ForElm)) TmpLst))
)
(entmod (list (cons -1 EntNam) (cons -3 TmpLst)))
)
; DXF Funzione di ricerca codici dxf.
;
(defun Dxf (DxfCod EntDat) (cdr (assoc DxfCod EntDat)))

Terminator
Utente Master



725 Messaggi

Inserito il - 26 aprile 2011 : 02:20:22  Mostra Profilo Invia a Terminator un Messaggio Privato  Rispondi Quotando
Adesso li elimina...



Scarica allegato:

rimxdata.zip
1,14 KB

PS: De nada

Modificato da - Terminator in data 27 aprile 2011 16:52:50
Torna all'inizio della Pagina

arri
Utente Master


Regione: Lombardia


14951 Messaggi

Inserito il - 26 aprile 2011 : 07:49:18  Mostra Profilo Invia a arri un Messaggio Privato  Rispondi Quotando
Messaggio inserito da Terminator

Adesso li elimina...



Scarica allegato:

rimxdata.zip
1,14 KB


Grazie Terminator
Questo è un bel regalo di Pasqua
Torna all'inizio della Pagina
  Discussione Precedente Discussione Discussione Successiva  
 Nuova Discussione  Rispondi
 Versione Stampabile Bookmark this Topic Aggiungi Segnalibro
Vai a:
TuttoCAD Forum © 2001-2010 CADLandia Torna all'inizio della Pagina
Pagina generata in 0,51 secondi.