Aller au contenu

Extraire des blocs


grand_sapin

Messages recommandés

Bonjour,

 

j'ai un dessin "gabarit" où sont répertoriés tous les blocs de la "charte graphique" à utiliser.

J'aimerai les extraire tous afin de pouvoir créer une commande pour les insérer un par un.

Je me vois mal faire un WBLOC pour chacun d'eux. sad.gif

Y a-t-il un moyen plus rapide d'effectuer cela ?

 

D'avance Merci

Sapin

Lien vers le commentaire
Partager sur d’autres sites

Hello

 

J'ai une vieille routine WBLOCKM qui marche tres bien !

Tu crees un dossier/catalogue du genre "C:\TRAVAIL"

et tu lui indiques CE dossier a la question "DS> Target Folder:" !

 

lecrabe

 


; ----------------------------------------------------------------------
;          (Wblocks all local block definitions to target path)
;            Copyright (C) 2000 DotSoft, All Rights Reserved
;                   Website: http://www.dotsoft.com
; ----------------------------------------------------------------------
; DISCLAIMER:  DotSoft Disclaims any and all liability for any damages
; arising out of the use or operation, or inability to use the software.
; FURTHERMORE, User agrees to hold DotSoft harmless from such claims.
; DotSoft makes no warranty, either expressed or implied, as to the
; fitness of this product for a particular purpose.  All materials are
; to be considered ‘as-is’, and use of this software should be
; considered as AT YOUR OWN RISK.
; ----------------------------------------------------------------------

(defun c:wblockm ()
 (setq cmdecho (getvar "CMDECHO"))
 (setvar "CMDECHO" 0)
 ;
 (if (not dos_getdir)
   (setq path (getstring "\nDS> Target Folder: " T))
   (setq path (dos_getdir "Target Folder" (getvar "DWGPREFIX")))
 )
 (if (/= path nil)
   (progn
     (if (= (substr path (strlen path) 1) "\\")
       (setq path (substr path 1 (1- (strlen path))))
     ) 
     (princ "\nDS> Building List of Blocks ... ")
     (setq lst nil)
     (setq itm (tblnext "BLOCK" T))
     (while (/= itm nil)
       (setq nam (cdr (assoc 2 itm)))
       (setq pass T)
       (if (/= (cdr (assoc 1 itm)) nil)
         (setq pass nil)
         (progn
           (setq ctr 1)
           (repeat (strlen nam)
             (setq chk (substr nam ctr 1))
             (if (or (= chk "*")(= chk "|"))
               (setq pass nil)
             )
             (setq ctr (1+ ctr))
           )
         )
       )
       (if (= pass T)
         (setq lst (cons nam lst))
       )
       (setq itm (tblnext "BLOCK"))
     )
     (setq lst (acad_strlsort lst))
     (princ "Done.")
     ;
     (foreach blk lst
       (setq fn (strcat path (chr 92) blk))
       (if (findfile (strcat fn ".dwg"))
         (command "_.WBLOCK" fn "_Y" blk)
         (command "_.WBLOCK" fn blk)
       )
     )
   )
 )
 ;
 (setvar "CMDECHO" cmdecho)
 (princ)
)

Autodesk Expert Elite Team

Lien vers le commentaire
Partager sur d’autres sites

Hello

 

NON teste mais je crains que cela ne change pas grand chose !?

car quand tu fais un manuellement une commande WBLOC / WBLOCK

automatiquement MAP (ou CIVIL) te pose cette question debile qui ne sert a rien

"Inclure les Informations MAP ..."

En plus que tu repondes Oui ou Non, cela ne change RIEN au resultat !

 

AU fait, c IDEM avec EXPERT = 5

 

lecrabe

Autodesk Expert Elite Team

Lien vers le commentaire
Partager sur d’autres sites

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer. Politique de confidentialité