Aller au contenu

MODIFIER NOM DES PRESENTATIONS


PHILPHIL

Messages recommandés

Bonsoir

 

un LISP pour modifier les noms des presentations

si ca peut servir

 

fonction : change_nom_presentation

 

boite de dialogue de Gile fichier dialog.lsp

 

Phil

 

( on ne peut plus joint de fichier LISP ? )

 

 

;;;-----------------------------------
;;;CHANGE_NOM_PRESENTATION
;;;-----------------------------------


(defun c:change_nom_presentation ()
 (setvar "cmdecho" 0)
 (setq typeactioncnp (getcfg "APPDATA/typeactioncnp"))
 (prompt "\n 1 : REMPLACER LE DERNIER CARACTERE DU NOM DES PRESENTATIONS")
 (prompt "\n 2 : REMPLACER LE PREMIER CARACTERE DU NOM DES PRESENTATIONS")
 (prompt "\n 3 : REMPLACER A PARTIR DE Y CARACTERES DEPUIS LE DEBUT SUR LE(S) X CARACTERE(S) [sI X=0 CORRESPOND A INSERER]"  )
 (prompt "\n 4 : SOUSTRAIRE LES X DERNIERS CARACTERES DU NOM")
 (prompt "\n 5 : SOUSTRAIRE LES X PREMIERS CARACTERES DU NOM")
 (prompt "\n 6 : INCREMENTER SUR 3 CARACTERES EN REMPLACANT LES 4 IEME A 2 IEME A PARTIR DE LA FIN")
 (prompt "\n 7 : REMPLACER DES CARACTERES DANS LE NOM")
 (initget "1 2 3 4 5 6 7")
 (setq tmp (getkword (strcat "\nSELECTIONNER LE TYPE D'ACTION DESIRE ( 1 2 3 4 5 6 7 ) <" typeactioncnp "> : ")
           )
 )
 (if tmp
   (setq typeactioncnp tmp)
 )
 (setcfg "APPDATA/typeactioncnp" typeactioncnp)
 (if (= typeactioncnp "1")
   (progn (c:cnpfin))
 )
 (if (= typeactioncnp "2")
   (progn (c:cnpdebut))
 )
 (if (= typeactioncnp "3")
   (progn (c:cnpdepuisysurx))
 )
 (if (= typeactioncnp "4")
   (progn (c:cnpsoutrairxcaractdefin))
 )
 (if (= typeactioncnp "5")
   (progn (c:cnpsoutrairxcaractdepuisdebut))
 )
 (if (= typeactioncnp "6")
   (progn (c:cnpincrementer4a2fin))
 )
 (if (= typeactioncnp "7")
   (progn (c:cnpremplacecaract))
 )
 (princ)
)














(defun c:cnpfin ()
 (setvar "cmdecho" 0)
 (setq cnpcdefin (getcfg "APPDATA/CNPCDEFIN"))
 (setq com1 (getstring t
                       (strcat "\nVEUILLEZ ENTRER LE(S) CARACTERE(S) EN REMPLACEMENT DU DERNIER CARACTERE DU NOM <"
                               cnpcdefin
                               "> : "
                       )
            )
 )
 (if (/= com1 "")
   (setq cnpcdefin com1)
 )
 (setcfg "APPDATA/CNPCDEFIN" cnpcdefin)
 (setq layouts (getlayouts nil t))
 (foreach layout layouts
   (progn (setq nouveaunom (strcat (substr layout 1 (- (strlen layout) 1)) cnpcdefin))
          (command "_.layout" "_ren" layout nouveaunom)
          (princ)
   )
 )
)


(defun c:cnpdebut ()
 (setvar "cmdecho" 0)
 (setq cnpcdedebut (getcfg "APPDATA/CNPCDEDEBUT"))
 (setq com1 (getstring t
                       (strcat "\nVEUILLEZ ENTRER LE(S) CARACTERE(S) EN REMPLACEMENT DU PREMIER CARACTERE DU NOM <"
                               cnpcdedebut
                               "> : "
                       )
            )
 )
 (if (/= com1 "")
   (setq cnpcdedebut com1)
 )
 (setcfg "APPDATA/CNPCDEDEBUT" cnpcdedebut)
 (setq layouts (getlayouts nil t))
 (foreach layout layouts
   (progn (setq nouveaunom (strcat cnpcdedebut (substr layout 2)))
          (command "_.layout" "_ren" layout nouveaunom)
          (princ)
   )
 )
)






(defun c:cnpdepuisysurx ()
 (setvar "cmdecho" 0)
 (setq cnpcdepuisysurx (getcfg "APPDATA/CNPCDEPUISYSURX"))
 (setq com1 (getstring t
                       (strcat "\nVEUILLEZ ENTRER LE(S) CARACTERE(S) EN REMPLACEMENT DES CARACTERES DU NOM <"
                               cnpcdepuisysurx
                               "> : "
                       )
            )
 )
 (if (/= com1 "")
   (setq cnpcdepuisysurx com1)
 )
 (setcfg "APPDATA/CNPCDEPUISYSURX" cnpcdepuisysurx)
 (setq cnpcdepuisdebut (atoi (getcfg "APPDATA/CNPCDEPUISDEBUT")))
 (initget 4)
 (setq tmp (getint
             (strcat "\nENTRER UN NOMBRE POUR DEFINIR LE DEBUT DU REMPLACEMENT DEPUIS LE DEBUT DU NOM [ MINIMUM : 1]<"
                     (rtos cnpcdepuisdebut 2 0)
                     ">: "
             )
           )
 )
 (if tmp
   (setq cnpcdepuisdebut tmp)
 )
 (setcfg "APPDATA/CNPCDEPUISDEBUT" (rtos cnpcdepuisdebut 2 0))
 (setq cnpcsurx (atoi (getcfg "APPDATA/CNPCSURX")))
 (initget 4)
 (setq tmp (getint (strcat "\nENTRER UN NOMBRE POUR DEFINIR LA PLAGE DU REMPLACEMENT DU NOM <"
                           (rtos cnpcsurx 2 0)
                           ">: "
                   )
           )
 )
 (if tmp
   (setq cnpcsurx tmp)
 )
 (setcfg "APPDATA/CNPCSURX" (rtos cnpcsurx 2 0))
 (setq layouts (getlayouts nil t))
 (foreach layout layouts
   (progn (setq nouveaunom (strcat (substr layout 1 (- cnpcdepuisdebut 1))
                                   cnpcdepuisysurx
                                   (substr layout (+ cnpcdepuisdebut cnpcsurx))
                           )
          )
          (command "_.layout" "_ren" layout nouveaunom)
          (princ)
   )
 )
)




(defun c:cnpsoutrairxcaractdefin ()
 (setvar "cmdecho" 0)
 (setq cnpsoustraicaractalafin (atoi (getcfg "APPDATA/CNPSOUSTRAICARACTALAFIN")))
 (initget 4)
 (setq tmp (getint (strcat "\nENTRER LE NOMBRE DE CARACTERES A SUPPRIMER A LA FIN DU NOM <"
                           (rtos cnpsoustraicaractalafin 2 0)
                           ">: "
                   )
           )
 )
 (if tmp
   (setq cnpsoustraicaractalafin tmp)
 )
 (setcfg "APPDATA/CNPSOUSTRAICARACTALAFIN" (rtos cnpsoustraicaractalafin 2 0))
 (setq layouts (getlayouts nil t))
 (foreach layout layouts
   (progn (setq nouveaunom (strcat (substr layout 1 (- (strlen layout) cnpsoustraicaractalafin))))
          (command "_.layout" "_ren" layout nouveaunom)
          (princ)
   )
 )
)




(defun c:cnpsoutrairxcaractdepuisdebut ()
 (setvar "cmdecho" 0)
 (setq cnpsoustraicaractdepuisdebut (atoi (getcfg "APPDATA/CNPSOUSTRAICARACTDEPUISDEBUT")))
 (initget 4)
 (setq tmp (getint (strcat "\nENTRER LE NOMBRE DE CARACTERES A SUPPRIMER DEPUIS LE DEBUT DU NOM <"
                           (rtos cnpsoustraicaractdepuisdebut 2 0)
                           ">: "
                   )
           )
 )
 (if tmp
   (setq cnpsoustraicaractdepuisdebut tmp)
 )
 (setcfg "APPDATA/CNPSOUSTRAICARACTDEPUISDEBUT" (rtos cnpsoustraicaractdepuisdebut 2 0))
 (setq layouts (getlayouts nil t))
 (foreach layout layouts
   (progn (setq nouveaunom (strcat (substr layout (+ cnpsoustraicaractdepuisdebut 1))))
          (command "_.layout" "_ren" layout nouveaunom)
          (princ)
   )
 )
)


(defun c:cnpincrementer4a2fin ()
 (setvar "cmdecho" 0)
 (setq cnpnbdpincrement (atoi (getcfg "APPDATA/CNPNBDPINCREMENT")))
 (initget 4)
 (setq tmp (getint
             (strcat "\nENTRER LE NOMBRE DE DEBUT D'INCREMENTATION DU NOM <" (rtos cnpnbdpincrement 2 0) ">: ")
           )
 )
 (if tmp
   (setq cnpnbdpincrement tmp)
 )
 (setcfg "APPDATA/CNPNBDPINCREMENT" (rtos cnpnbdpincrement 2 0))
 (setq layouts (getlayouts nil t))
 (foreach layout layouts
   (progn (if (= (strlen (rtos cnpnbdpincrement 2 0)) 1)
            (setq nombre (strcat "00" (rtos cnpnbdpincrement 2 0)))
          )
          (if (= (strlen (rtos cnpnbdpincrement 2 0)) 2)
            (setq nombre (strcat "0" (rtos cnpnbdpincrement 2 0)))
          )
          (if (= (strlen (rtos cnpnbdpincrement 2 0)) 3)
            (setq nombre (strcat (rtos cnpnbdpincrement 2 0)))
          )
          (setq nouveaunom (strcat (substr layout 1 (- (strlen layout) 4)) nombre (substr layout (strlen layout))))
          (command "_.layout" "_ren" layout nouveaunom)
          (setq cnpnbdpincrement (1+ cnpnbdpincrement))
          (princ)
   )
 )
)




(defun c:cnpremplacecaract ()
 (setvar "cmdecho" 0)
 (setq cnpcaremplacer (getcfg "APPDATA/CNPCAREMPLACER"))
 (setq com1 (getstring t
                       (strcat "\nVEUILLEZ ENTRER LE(S) CARACTERE(S) A REMPLACER DANS LE NOM <" cnpcaremplacer "> : ")
            )
 )
 (if (/= com1 "")
   (setq cnpcaremplacer com1)
 )
 (setcfg "APPDATA/CNPCAREMPLACER" cnpcaremplacer)
 (setq cnpcremplacant (getcfg "APPDATA/CNPCREMPLACANT"))
 (setq com1 (getstring t
                       (strcat "\nVEUILLEZ ENTRER LE(S) CARACTERE(S) DE REMPLACEMENT DANS LE NOM <" cnpcremplacant "> : ")
            )
 )
 (if (/= com1 "")
   (setq cnpcremplacant com1)
 )
 (setcfg "APPDATA/CNPCREMPLACANT" cnpcremplacant)
 (setq layouts (getlayouts nil t))
 (foreach layout layouts
   (progn (setq nouveaunom (vl-string-subst cnpcremplacant cnpcaremplacer layout))
          (command "_.layout" "_ren" layout nouveaunom)
          (princ)
   )
 )
)

Autodesk Architecture 2023 sous windows 11 64

24 pouces vertical + 30 pouces horizontal + 27 pouces horizontal

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é