Aller au contenu

infos mises a jour auto a l\'interieur du cartouche?


Messages recommandés

Posté(e)

bonjour

des sorties papier de fichier .dwg, avec des infos à jour automatiques style "excel "pour ne pas le nommer,(entete et pied de page) le genre date, heure , nom de fichier....

ca m'interesse de savoir si c'est possible avec autocad et si tel est le cas, quelle procedure adopter?

faut il creer un programme ou bien autodesk a pensé à tout?

y a t il une fonction qui se cache?

 

merci

Posté(e)

Confronté à un problème de discussion par téléphone sur deux plans diffèrents de part et d'autres.

J'ai créer une solution en lisp d'un cartouche mis à jour automatiquement.

Celui ci comporte des champs automatique et fixe.

 

Les automatiques:

* date création

* date de modification

* date de tracé (ou impression)

* nom du fichier DWG

* nom du dossier (ou chemin des répertoires informatique) où se trouve ce dessin

* Le nom de l'onglet où est inseré ce cartouche automatique (il peut l'être plusieurs fois)

* nom du login de la machine

* L'échelle du dessin si le cartouche est inséré dans l'espace papier (dans l'espace objet c'est un champ fixe dont la valeur est demandé à l'insertion)

* La version d'AutoCAD utilisé.

* La version de la plateforme où est installé le logiciel.

 

Les fixes:

* Un champ pour un numéro (ou autres) de classement

* L'échelle du dessin à fixer au départ si le cartouche est dans l'espace objet.

 

L'insertion se fait à travers une boite de dialogue. Il est possible d'en mettre autant que l'on en veut, leurs mise à jour se fera à l'ouverture du dessin, et avant l'impression.

L'insertion dans l'espace papier, vous demanderas d'y associer une fenêtre afin de restituer l'échelle. Si vous changez le facteur de zoom de la fenêtre, l'échelle sera mis à jour dans le cartouche pour l'impression.

 

2006 je pense dois pouvoir faire la même chose sans programmation, ou peu.

Si cela t'interesse, fais le savoir (le code est long)

Choisissez un travail que vous aimez et vous n'aurez pas à travailler un seul jour de votre vie. - Confucius

Posté(e)

Bonsoir bonuscad,

Moi je suis très intéressé par ton programme en lisp.

Y-t-il moyen de l'avoir? ;)

Merci d'avance.

" Celui qui a déplacé la montagne, c'est celui qui a commencé par enlever les petites pierres "

Posté(e)

A sauvegarder dans un 1er fichier nommé "Tatouage.lsp" qui sera placé dans un dossier de recherche d'autocad (ou le créer !)

 

Avant de sauvegarder, ENLEVER les espace apres le symbole > (faire une recherche dans le fichier avec " < puis avec > ") Ceci est du a un problème d'interprétation sur le forum qui "squizze" des caractère après le >.

 

Le fichier Lisp est long car il contient la création graphique du bloc

 

(defun recerr (ch)
(cond
	((eq ch "Function cancelled") nil)
	((eq ch "quit / exit abort") nil)
	((eq ch "console break") nil)
	(T (princ ch))
)
(command "_.undo" "_end")
(command "_.u")
(if (<= sv_und 3) (command "_.undo" "_control" "_one"))
(setq *error* olderr)
(princ)
)
(defun do_x_pt()
(check_real (setq x_pt (get_tile "x_pt")) "x_pt")
)
(defun do_y_pt()
(check_real (setq y_pt (get_tile "y_pt")) "y_pt")
)
(defun do_z_pt()
(check_real (setq z_pt (get_tile "z_pt")) "z_pt")
)
(defun check_real (real_number coord)
(if (distof real_number 2)
	(progn 
		(set_tile "error" "") 
		real_number
	)
	(progn 
		(set_tile "error" 
			(strcat "Coordonnée " 
				(strcase (substr coord 1 1)) 
				" Incorrecte."
			)
		)
		nil
	)
)
) 
(defun tstval (val / val)
(if (= (type (read val)) 'INT)
	(progn
		(setq blk_sca (atoi val))
		(set_tile "error" "")
	)
	(progn
		(set_tile "error" "Valeur entière incorrecte !")
		(set_tile "c_ech" (itoa blk_sca))
	)
)
)
(defun tstang (val / val)
(if (angtof val)
	(progn
		(setq blk_rot (angtof val))
		(set_tile "error" "")
	)
	(progn
		(set_tile "error" "Valeur numérique incorrecte !")
		(set_tile "b_o" (angtos blk_rot))
	)
)
)
(defun l_chg (index / )
(setq blk_sca
	(read
		(nth
			(atoi index)
			'("25" "50" "100" "200" "500" "1000" "2000" "2500" "5000" "10000")
		)
	)
)
(set_tile "c_ech" (itoa blk_sca))
)
(defun transpts (apt matrix / )
(list
	(+
		(* (car (nth 0 matrix)) (car apt))
		(* (car (nth 1 matrix)) (cadr apt))
		(* (car (nth 2 matrix)) (caddr apt))
		(cadddr (nth 0 matrix))
	)
	(+
		(* (cadr (nth 0 matrix)) (car apt))
		(* (cadr (nth 1 matrix)) (cadr apt))
		(* (cadr (nth 2 matrix)) (caddr apt))
		(cadddr (nth 1 matrix))
	)
	(+
		(* (caddr (nth 0 matrix)) (car apt))
		(* (caddr (nth 1 matrix)) (cadr apt))
		(* (caddr (nth 2 matrix)) (caddr apt))
		(cadddr (nth 2 matrix))
	)
)
)
(defun v_matr (dpt alphax alphay alphaz echx echy echz / )
(list
	(list
		(* echx (cos alphaz) (cos alphay))
		(- (sin alphaz))
		(sin alphay)
		(car dpt)
	)
	(list
		(sin alphaz)
		(* echy (cos alphaz) (cos alphax))
		(- (sin alphax))
		(cadr dpt)
	)
	(list
		(- (sin alphay))
		(sin alphax)
		(* echz (cos alphax) (cos alphay))
		(caddr dpt)
	)
	(list 0.0 0.0 0.0 1.0)
)
)
(defun def_date (td / j y d m)
(setq j (- (fix td) 1721119.0))
(setq y (fix (/ (1- (* 4 j)) 146097.0)))
(setq j (- (* j 4.0) 1.0 (* 146097.0 y)))
(setq d (fix (/ j 4.0)))
(setq j (fix (/ (+ (* 4.0 d) 3.0) 1461.0)))
(setq d (- (+ (* 4.0 d) 3.0) (* 1461.0 j)))
(setq d (fix (/ (+ d 4.0) 4.0)))
(setq m (fix (/ (- (* 5.0 d) 3) 153.0)))
(setq d (- (* 5.0 d) 3.0 (* 153.0 m)))
(setq d (fix (/ (+ d 5.0) 5.0)))
(setq y (+ (* 100.0 y) j))
(if (< m 10.0)
	(setq m (+ m 3))
	(progn	
		(setq m (- m 9))
		(setq y (1+ y))
	)
)
(strcat
	(itoa (fix d))
	"/"
	(itoa (fix m))
	"/"
	(itoa (fix y))
)
)
(defun make_blk_record ( / )
    (if (not (tblsearch "LAYER" "Enregistrement Dessin"))
      (entmake	'((0 . "LAYER")
	  (100 . "AcDbSymbolTableRecord")
	  (100 . "AcDbLayerTableRecord")
	  (2 . "Enregistrement Dessin")
	  (70 . 0)
	  (62 . 7)
	  (370 . -3)
	  (6 . "Continuous")
	 )
      )
    )
    (if (not (tblsearch "STYLE" "$RECORD"))
      (entmake	'((0 . "STYLE")
	  (5 . "40")
	  (100 . "AcDbSymbolTableRecord")
	  (100 . "AcDbTextStyleTableRecord")
	  (2 . "$RECORD")
	  (70 . 0)
	  (40 . 0.0)
	  (41 . 1.0)
	  (50 . 0.0)
	  (71 . 0)
	  (42 . 1.54508)
	  (3 . "simplex.shx")
	  (4 . "")
	 )
      )
    )
    (if (not (tblsearch "BLOCK" "RECORD_BONUSCAD"))
      (progn
 (entmake
   '((0 . "BLOCK") (8 . "0") (2 . "RECORD_BONUSCAD") (70 . 2) (4 . "") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2) (10 0.0 0.0 0.0))
 )
 (entmake '(
(0 . "LWPOLYLINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbPolyline")
(90 . 8)
(70 . 1)
(43 . 0.618034)
(38 . 0.0)
(39 . 0.0)
(10 0.999998 0.0)
(40 . 0.618034)
(41 . 0.618034)
(42 . 0.0)
(10 60.8034 0.0)
(40 . 0.618034)
(41 . 0.618034)
(42 . 0.414214)
(10 61.8034 0.999998)
(40 . 0.618034)
(41 . 0.618034)
(42 . 0.0)
(10 61.8034 37.1966)
(40 . 0.618034)
(41 . 0.618034)
(42 . 0.414214)
(10 60.8034 38.1966)
(40 . 0.618034)
(41 . 0.618034)
(42 . 0.0)
(10 0.999998 38.1966)
(40 . 0.618034)
(41 . 0.618034)
(42 . 0.414214)
(10 0.0 37.1966)
(40 . 0.618034)
(41 . 0.618034)
(42 . 0.0)
(10 0.0 0.999998)
(40 . 0.618034)
(41 . 0.618034)
(42 . 0.414214)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 0.0 32.7399 0.0)
(11 61.8034 32.7399 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 0.0 27.2833 0.0)
(11 61.8034 27.2833 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 0.0 21.8266 0.0)
(11 61.8034 21.8266 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 0.0 16.37 0.0)
(11 61.8034 16.37 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 0.0 10.9133 0.0)
(11 61.8034 10.9133 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 0.0 5.45666 0.0)
(11 61.8034 5.45666 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 20.6011 38.1966 0.0)
(11 20.6011 32.7399 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 41.2023 38.1966 0.0)
(11 41.2023 32.7399 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbLine")
(10 30.9017 16.37 0.0)
(11 30.9017 10.9133 0.0)
(210 0.0 0.0 1.0)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 1.91591 34.6957 0.0)
(40 . 1.54508)
(1 . "Créé le:")
(50 . 0.0)
(41 . 0.75)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 1.91591 35.4683 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 22.517 34.6957 0.0)
(40 . 1.54508)
(1 . "Modifié le:")
(50 . 0.0)
(41 . 0.75)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 22.517 35.4683 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 43.1181 34.6957 0.0)
(40 . 1.54508)
(1 . "Tracé le:")
(50 . 0.0)
(41 . 0.75)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 43.1181 35.4683 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 1.91591 29.2391 0.0)
(40 . 1.54508)
(1 . "Fichier :")
(50 . 0.0)
(41 . 0.75)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 1.91591 30.0116 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 1.91591 23.7824 0.0)
(40 . 1.54508)
(1 . "Dossier :")
(50 . 0.0)
(41 . 0.75)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 1.91591 24.5549 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model") 
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 1.91591 18.3257 0.0)
(40 . 1.54508)
(1 . "Onglet :")
(50 . 0.0)
(41 . 0.75)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 1.91591 19.0982 0.0)
(210 0.0 0.0 1.0) 
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 1.91591 12.8691 0.0)
(40 . 1.54508)
(1 . "Auteur :")
(50 . 0.0)
(41 . 0.75)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 1.91591 13.6416 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 32.8176 12.8691 0.0)
(40 . 1.54508)
(1 . "Classement :")
(50 . 0.0)
(41 . 0.75)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 32.8176 13.6416 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 1.91591 7.10344 0.0)
(40 . 2.16312)
(1 . "Echelle :")
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 1.91591 8.18499 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 1.91591 3.57334 0.0)
(40 . 1.0383)
(1 . "AutoCAD Release :")
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 1.91591 4.09249 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "TEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 1.91591 0.845013 0.0)
(40 . 1.0383)
(1 . "AutoCAD Version :")
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 1.91591 1.36416 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbText")
(73 . 2)
	)
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model") 
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(39 . 1.0)
(100 . "AcDbText")
(10 40.507 3.55171 0.0)
(40 . 1.08156)
(1 . "1") 
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 1)
(11 46.3525 4.09249 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Mode d'unités en mm utilisées en EO ?:")
(2 . "DWG_ID_UNITS")
(70 . 1)
(73 . 0)
(74 . 2)
	)
)
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 39.6057 0.823382 0.0)
(40 . 1.08156)
(1 . "2")
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 1)
(11 46.3525 1.36416 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Espace objet/papier utilisé ?:")
(2 . "DWG_ID_CVPORT")
(70 . 1)
(73 . 0)
(74 . 2)
	)
)
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 9.14678 34.6957 0.0)
(40 . 1.54508)
(1 . "00/00/0000")
(50 . 0.0)
(41 . 0.5)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 9.14678 35.4683 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Date de création ?:")
(2 . "DWG_CREATE_DATE")
(70 . 0)
(73 . 0)
(74 . 2)
	)
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 31.8442 34.6957 0.0)
(40 . 1.54508)
(1 . "00/00/0000")
(50 . 0.0)
(41 . 0.5)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 31.8442 35.4683 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Date de modification ?:")
(2 . "DWG_MODIF_DATE")
(70 . 0)
(73 . 0)
(74 . 2)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 51.2304 34.6957 0.0)
(40 . 1.54508)
(1 . "00/00/0000")
(50 . 0.0)
(41 . 0.5)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 51.2304 35.4683 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Date de traçage ?:")
(2 . "DWG_PLOT_DATE")
(70 . 0)
(73 . 0)
(74 . 2)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 10.1464 29.1689 0.0)
(40 . 1.54508)
(1 . "SANSNOM")
(50 . 0.0)
(41 . 3.95354)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(11 59.8875 29.1689 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Nom du fichier dessin ?:")
(2 . "DWG_NAME")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 10.1464 23.7122 0.0)
(40 . 1.54508)
(1 . "SANSDOSSIER")
(50 . 0.0)
(41 . 3.36346)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(11 59.8875 23.7122 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Aborescence du dossier utilisé ?:")
(2 . "DWG_FOLDER")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 10.1464 18.2555 0.0)
(40 . 1.54508)
(1 . "Objet")
(50 . 0.0)
(41 . 4.0973)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(11 59.8875 18.2555 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Onglet utilisé ?:")
(2 . "DWG_CTAB")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 10.202 12.8631 0.0)
(40 . 1.54508)
(1 . "BonusCAD")
(50 . 0.0)
(41 . 1.702)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(11 28.9858 12.8631 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Nom du dessinateur ?:")
(2 . "DWG_MAN")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 44.3797 12.8523 0.0)
(40 . 1.54508)
(1 . "XXX")
(50 . 0.0)
(41 . 1.14551)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(11 59.8875 12.8523 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Identification de classement ?:")
(2 . "DWG_CLASS")
(70 . 0)
(73 . 2)
(74 . 0)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 18.2427 6.97247 0.0)
(40 . 2.16312)
(1 . "1/1")
(50 . 0.0)
(41 . 2.20927)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(11 59.8875 6.97247 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Echelle du dessin ?:")
(2 . "DWG_SCALE")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 20.6423 3.57334 0.0)
(40 . 1.0383)
(1 . "Inconnu")
(50 . 0.0)
(41 . 1.0)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 20.6423 4.09249 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Version utilisée ?:")
(2 . "DWG_RELEASE")
(70 . 0)
(73 . 0)
(74 . 2)
	   )
 )
 (entmake '(
(0 . "ATTDEF")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(10 20.6423 0.845013 0.0)
(40 . 1.0383)
(1 . "Inconnu")
(50 . 0.0)
(41 . 0.65)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(11 20.6423 1.36416 0.0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(3 . "Environnement Hardware?")
(2 . "DWG_PLATFORM")
(70 . 0)
(73 . 0)
(74 . 2)
	   )
 )
 (entmake '((0 . "ENDBLK") (8 . "0") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2)))
      )
    )
)
(defun make_ins_record (point_insertion angle_rotation factor_scale unit_scale id_vport ename_fmult / transformp transforma transforms e_blk xname newdict)
(if (/= id_vport 2) (setq factor_scale (* factor_scale unit_scale)))
(setq transformp (v_matr point_insertion 0.0 0.0 0 1.0 1.0 1.0)
     transforma (v_matr '(0.0 0.0 0.0) 0.0 0.0 (- angle_rotation) 1.0 1.0 1.0)
     transforms (v_matr '(0.0 0.0 0.0) 0.0 0.0 0.0 (/ factor_scale unit_scale) (/ factor_scale unit_scale) (/ factor_scale unit_scale))
)
      (entmake
 (append
	'(
(0 . "INSERT")
(100 . "AcDbEntity")
(8 . "Enregistrement Dessin")
(6 . "ByLayer")
(62 . 256)
(370 . -1)
(100 . "AcDbBlockReference")
(66 . 1)
(2 . "RECORD_BONUSCAD")
(70 . 0)
(71 . 0)
(44 . 0.0)
(45 . 0.0)
(210 0.0 0.0 1.0)
	   )
   (list (cons 10 point_insertion))
   (list (cons 50 angle_rotation))
   (list (cons 41 (/ factor_scale unit_scale)))
   (list (cons 42 (/ factor_scale unit_scale)))
   (list (cons 43 (/ factor_scale unit_scale)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(41 . 1.0)
(51 . 0.0) 
(7 . "$RECORD")
(71 . 0)
(72 . 1)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_ID_UNITS")
(70 . 1)
(73 . 0)
(74 . 2)
	   )
(list (cons 1 (rtos unit_scale 2 2)))
(list (cons 10 (transpts (transpts (transpts '(40.507 3.55171 0.0) transforms) transforma) transformp)))
(list (cons 39 factor_scale))
(list (cons 40 (* 1.3125 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(46.3525 4.09249 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(41 . 1.0)
(51 . 0.0) 
(7 . "$RECORD")
(71 . 0)
(72 . 1)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_ID_CVPORT")
(70 . 1)
(73 . 0)
(74 . 2)
	   )
(list (cons 1 (itoa id_vport)))
(list (cons 10 (transpts (transpts (transpts '(39.6057 0.823382 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.3125 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(46.3525 1.36416 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "00/00/00")
(41 . 0.5)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_CREATE_DATE")
(70 . 0)
(73 . 0)
(74 . 2)
	)
(list (cons 10 (transpts (transpts (transpts '(9.14678 34.6957 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.875 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(9.14678 35.4683 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
)
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "00/00/0000")
(41 . 0.5)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_MODIF_DATE")
(70 . 0)
(73 . 0)
(74 . 2)
	   )
(list (cons 10 (transpts (transpts (transpts '(31.8442 34.6957 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.875 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(31.8442 35.4683 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "00/00/0000")
(41 . 0.5)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_PLOT_DATE")
(70 . 0)
(73 . 0)
(74 . 2)
	   )
(list (cons 10 (transpts (transpts (transpts '(51.2304 34.6957 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.875 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(51.2304 35.4683 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "SANSNOM")
(41 . 3.95354)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_NAME")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
(list (cons 10 (transpts (transpts (transpts '(10.1464 29.1689 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.875 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(59.8875 29.1689 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "SANSDOSSIER")
(41 . 3.36346)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_FOLDER")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
(list (cons 10 (transpts (transpts (transpts '(10.1464 23.7122 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.875 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(59.8875 23.7122 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
(entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "Objet")
(41 . 4.0973)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(210 0.0 0.0 1.0)
(100 . "AcDbAttributeDefinition")
(2 . "DWG_CTAB")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
(list (cons 10 (transpts (transpts (transpts '(10.1464 18.2555 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.875 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(59.8875 18.2555 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
(entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "BonusCAD")
(41 . 1.6796)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_MAN")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
(list (cons 10 (transpts (transpts (transpts '(10.202 12.8631 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.875 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(28.9858 12.8631 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
(entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "XXX")
(41 . 3.90322)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_CLASS")
(70 . 0)
(73 . 2)
(74 . 0)
	   )
(list (cons 10 (transpts (transpts (transpts '(44.3797 12.8523 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.875 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(59.8875 12.8523 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
(entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "1/1")
(41 . 9.40224)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 5)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_SCALE")
(70 . 0)
(73 . 0)
(74 . 0)
	   )
(list (cons 10 (transpts (transpts (transpts '(18.2427 6.97247 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 2.625 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(59.8875 6.97247 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "Inconnu")
(41 . 1.0)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_RELEASE")
(70 . 0)
(73 . 0)
(74 . 2)
	   )
(list (cons 10 (transpts (transpts (transpts '(20.6423 3.57334 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.26 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(20.6423 4.09249 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake
 (append
	'(
(0 . "ATTRIB")
(100 . "AcDbEntity")
(8 . "0")
(62 . 0)
(6 . "ByBlock")
(370 . -2)
(100 . "AcDbText")
(1 . "Inconnu")
(41 . 0.65)
(51 . 0.0)
(7 . "$RECORD")
(71 . 0)
(72 . 0)
(210 0.0 0.0 1.0)
(100 . "AcDbAttribute")
(2 . "DWG_PLATFORM")
(70 . 0)
(73 . 0)
(74 . 2)
	   )
(list (cons 10 (transpts (transpts (transpts '(20.6423 0.845013 0.0) transforms) transforma) transformp)))
(list (cons 40 (* 1.26 (/ factor_scale unit_scale))))
(list (cons 50 angle_rotation))
(list (cons 11 (transpts (transpts (transpts '(20.6423 1.36416 0.0) transforms) transforma) transformp)))
   (if (/= id_vport 2)
	(list '(67 . 1) (cons 410 (getvar "CTAB")))
	'((67 . 0) (410 . "Model"))
   )
 )
)
      (entmake '((0 . "SEQEND") (8 . "Enregistrement Dessin") (6 . "ByLayer") (62 . 256) (370 . -1)))
(if (and ename_fmult (/= id_vport 2))
(progn
	(setq e_blk (entlast))
	(if (null (dictsearch (namedobjdict) "BONUSCAD_RECORD"))
		(setq xname (entmakex '((0 . "DICTIONARY") (100 . "AcDbDictionary")))
		      newdict (dictadd (namedobjdict) "BONUSCAD_RECORD" xname)
		)
		(setq newdict (cdar (dictsearch (namedobjdict) "BONUSCAD_RECORD")))
	)
	(setq xname
		(entmakex
			(append
				'(
					(0 . "GROUP")
					(100 . "AcDbGroup")
					(300 . "Cartouche & FMULT")
					(70 . 0)
					(71 . 1)
				)
				(list
					(cons 340 e_blk)
					(cons 340 ename_fmult)
				)
			)
		)
	)
	(if (not (assoc 3 (dictsearch (namedobjdict) "BONUSCAD_RECORD")))
		(dictadd newdict "RECORD_1" xname)
		(dictadd newdict (strcat "RECORD_" (itoa (1+ (atoi (substr (cdr (assoc 3 (dictsearch (namedobjdict) "BONUSCAD_RECORD"))) 8))))) xname)
	)
)
)
)
(defun block_update (block_record flag / s_e fm_assoc dxf_e tag_value i_scale i_unit i_cvport blk_sca dict_record group_dxf)
(if (/= (getvar "ATTMODE") 1) (setvar "ATTMODE" 1))
(setq s_e block_record)
(if (not (zerop (cdr (assoc 67 (entget s_e)))))
	(setq fm_assoc (entget (cdr (assoc 330 (entget s_e)))))
)
(while (/= (cdr (assoc 0 (entget (setq s_e (entnext s_e))))) "SEQEND")
	(setq dxf_e (entget s_e))
	(if (eq (cdr (assoc 0 dxf_e)) "ATTRIB")
		(progn
			(setq tag_value (cdr (assoc 2 dxf_e)))
			(cond
				((eq tag_value "DWG_ID_UNITS")
					(setq i_scale (cdr (assoc 39 dxf_e)))
					(setq i_unit (atof (cdr (assoc 1 dxf_e))))
				)
				((eq tag_value "DWG_ID_CVPORT")
					(setq i_cvport (atoi (cdr (assoc 1 dxf_e))))
				)
				((eq tag_value "DWG_CREATE_DATE")
					(entmod (subst (cons 1 (def_date (getvar "TDCREATE"))) (assoc 1 dxf_e) dxf_e))
				)
				((eq tag_value "DWG_MODIF_DATE")
					(entmod (subst (cons 1 (def_date (getvar "TDUPDATE"))) (assoc 1 dxf_e) dxf_e))
				)
				((eq tag_value "DWG_PLOT_DATE")
					(entmod (subst (cons 1 (def_date (getvar "DATE"))) (assoc 1 dxf_e) dxf_e))
				)
				((eq tag_value "DWG_NAME")
					(entmod (subst (cons 1 (getvar "DWGNAME")) (assoc 1 dxf_e) dxf_e))
				)
				((eq tag_value "DWG_FOLDER")
					(entmod (subst (cons 1 (getvar "DWGPREFIX")) (assoc 1 dxf_e) dxf_e))
				)
				((eq tag_value "DWG_CTAB")
					(entmod (subst (cons 1 (if (= i_cvport 2) "Objet" (cdr (assoc 410 dxf_e)))) (assoc 1 dxf_e) dxf_e))
				)
				((and flag (eq tag_value "DWG_MAN"))
					(entmod (subst (cons 1 name_oper) (assoc 1 dxf_e) dxf_e))
				)
				((and flag (eq tag_value "DWG_CLASS"))
					(entmod (subst (cons 1 class_dwg) (assoc 1 dxf_e) dxf_e))
				)
				((eq tag_value "DWG_SCALE")
					(if (eq i_cvport 2)
					(setq blk_sca (fix i_scale))
					(cond
						((setq dict_record (dictsearch (namedobjdict) "BONUSCAD_RECORD"))
							(setq group_dxf (entget (cdr (last fm_assoc))))
							(setq blk_sca (atoi (rtos (/ i_unit (/ (cdr (assoc 41 group_dxf)) (cdr (assoc 45 group_dxf)))) 2 0)))
						)
						(T (setq blk_sca -1000))
					)
					)
					(entmod (subst (cons 1 (strcat "1/" (itoa blk_sca))) (assoc 1 dxf_e) dxf_e))
				)
				((eq tag_value "DWG_RELEASE")
					(entmod (subst (cons 1 (getvar "ACADVER")) (assoc 1 dxf_e) dxf_e))
				)
				((eq tag_value "DWG_PLATFORM")
					(entmod (subst (cons 1 (getvar "PLATFORM")) (assoc 1 dxf_e) dxf_e))
				)
			)
		)
	)
)
(entupd block_record)
)
(defun record ( / js_blk n ent_name_blk blk_sca)
(setq js_blk
	(ssget "X"
		'(
			(-4 . "< AND")
				(0 . "INSERT")
				(2 . "RECORD_BONUSCAD")
				(8 . "Enregistrement Dessin")
				(66 . 1)
			(-4 . "AND> ")
		)
	)
)
(cond
	(js_blk
		(princ "\nMise à jour du CARTOUCHE D'ENREGISTREMENT.")
		(if (eq (getvar "attmode") 2) (setvar "attmode" 1))
		(if (zerop (getvar "pickstyle")) (setvar "pickstyle" 1))
		(setq n 0)
		(while (setq ent_name_blk (ssname js_blk n))
			(setq blk_sca (cdr (assoc 41 (entget ent_name_blk))))
			(block_update ent_name_blk nil)
			(setq n (1+ n))
		)
	)
	(T (princ "\nAucun CARTOUCHE D'ENREGISTREMENT, pas de mise à jour!.\nCommande TATOUAGE pour créer un cartouche."))
)
(princ)
)
(defun reactors_record:update (a b / )
(if (= "PLOT" (car b))
	(record)
)
)
(defun c:tatouage ( / olderr sv_und blk_sca blk_rot blk_ins show_unit class_dwg name_oper dcl_id what_next blk_ins x_pt y_pt z_pt lock_zoom key e_fml js_fml)
(setvar "cmdecho" 0)
(setq olderr *error* *error* recerr)
(if (zerop (getvar "pickstyle")) (setvar "pickstyle" 1))
(if (<= (setq sv_und (getvar "undoctl")) 3)
	(command "_.undo" "_control" "_all")
)
(command "_.undo" "_group")
(if (eq (getvar "attmode") 2) (setvar "attmode" 1))
(if (not (tblsearch "BLOCK" "RECORD_BONUSCAD"))
	(make_blk_record)
)
(setq
	blk_sca (if (/= (getvar "CVPORT") 2) 1 100)
	blk_rot 0.0
	blk_ins nil e_fml nil lock_zoom "1"
	show_unit 1000.0
	class_dwg "XXX"
	name_oper (getvar "LOGINNAME")
)
(setq dcl_id (load_dialog "tatouage.dcl"))
(setq what_next 4)
(while (< 1 what_next)
	(if (not (new_dialog "tatouage" dcl_id)) (exit))
	(start_list "lst_ech")
		(mapcar
			'(lambda (x)
			(add_list x)
		)
		'("25" "50" "100" "200" "500" "1000" "2000" "2500" "5000" "10000")
	)
	(end_list)
	(set_tile "c_ech" (itoa blk_sca))
	(if x_pt (set_tile "x_pt" x_pt))
	(if y_pt (set_tile "y_pt" y_pt))
	(if z_pt (set_tile "z_pt" z_pt))
	(cond ((not (listp blk_ins))
		(set_tile "error" "Saisissez d'abord le point d'insertion!")
	      )
	      ((and (/= (getvar "CVPORT") 2) (not (listp e_fml)))
		(set_tile "error" "Saisissez une fenêtre de présentation!")
	      )
	      (T (set_tile "error" ""))
	)
	(set_tile "rotation" (angtos blk_rot))
	(set_tile "c_cla" class_dwg)
	(set_tile "c_des" name_oper)
	(set_tile "lock_fm" lock_zoom)
	(cond
		((= show_unit 1.0) (set_tile "b_mm" "1") (mode_tile "b_mm" 2))
		((= show_unit 10.0) (set_tile "b_cm" "1") (mode_tile "b_cm" 2))
		((= show_unit 1000.0) (set_tile "b_m" "1") (mode_tile "b_m" 2))
		((= show_unit 1000000.0) (set_tile "b_km" "1") (mode_tile "b_km" 2))
	)
	(if (/= (getvar "CVPORT") 2) (foreach n '("lst_ech" "c_ech") (mode_tile n 1)) (foreach n '("lock_fm" "pick_fmult") (mode_tile n 1)))
	(action_tile "lst_ech" "(l_chg $value)")
	(action_tile "c_ech" "(tstval $value)")
	(action_tile "pick_pt" "(done_dialog 2)")
	(action_tile "x_pt" "(do_x_pt)")  
	(action_tile "y_pt" "(do_y_pt)")  
	(action_tile "z_pt" "(do_z_pt)")  
	(action_tile "pick_ang" "(done_dialog 3)")
	(action_tile "pick_fmult" "(done_dialog 4)")
	(action_tile "lock_fm" "(setq lock_zoom $value)")
	(action_tile "rotation" "(tstang $value)")
	(action_tile "b_mm" "(setq show_unit 1.0)")
	(action_tile "b_cm" "(setq show_unit 10.0)")
	(action_tile "b_m" "(setq show_unit 1000.0)")
	(action_tile "b_km" "(setq show_unit 1000000.0)")
	(action_tile "c_cla" "(setq class_dwg $value)")
	(action_tile "c_des" "(setq name_oper $value)")
	(action_tile "accept" "(done_dialog 1)")
	(action_tile "cancel" "(done_dialog 0)")
	(setq what_next (start_dialog))
	(cond
	      ((= what_next 2)
		(initget 9)
		(setq blk_ins (getpoint "\nPoint d'insertion du cartouche: "))
       		(setq x_pt (rtos (car blk_ins) 2 4))
       		(setq y_pt (rtos (cadr blk_ins) 2 4))
       		(setq z_pt (rtos (caddr blk_ins) 2 4))
     		      )
	      ((= what_next 3)
		(initget 32)
		(setq blk_rot (getorient "\nAngle de rotation du cartouche ?<0>: "))
		(if (not blk_rot) (setq blk_rot 0))
	      )
	      ((= what_next 4)
(while (or (not e_fml) (not (listp e_fml)))
	(princ "\nChoisissez une fenêtre de présentation")
	(while (/= (car (setq key (grread T 4 2))) 3))
	(setq js_fml
		(ssget (cadr key)
			'(
				(-4 . "< AND")
					(0 . "VIEWPORT")
					(67 . 1)
				(-4 . "AND> ")
			)
		)
	)
	(if js_fml
		(cond
			((= (sslength js_fml) 1)
				(setq e_fml (entget (ssname js_fml 0)))
				(if (member '(102 . "{ACAD_REACTORS") e_fml)
					(progn (setq e_fml T) (princ "\nUn cartouche est déjà associé à cette fenêtre!\nChoisissez une autre fenêtre."))
					(progn
						(if (eq lock_zoom "1")
							(command "_.mview" "_lock" "_on" (cdar e_fml) "")
						)
						(setq e_fml (cons (cdar e_fml) (cadr key)))
					)
				)
			)
			(T
				(princ "\nPlusieurs fenêtres sélectionnées, une seule requise, recommencez.")
				(setq e_fml T)
			)
		)
		(progn (setq e_fml T) (princ "\nAucune fenêtre sélectionnée."))
	)
)
	      )
	      ((= what_next 1)
		(if (or (not blk_ins) (not (listp blk_ins)))
			(if (and x_pt y_pt z_pt)
				(setq blk_ins (list (atof x_pt) (atof y_pt) (atof z_pt)))
				(setq blk_ins T)
			)
		)
		(if (and (/= (getvar "CVPORT") 2) (or (not e_fml) (not (listp e_fml)))) (setq e_fml T))
		(cond
			((and (listp blk_ins) (if (/= (getvar "CVPORT") 2) (listp e_fml) T))
				(make_ins_record (trans blk_ins 1 0) (+ blk_rot (atan (/ (cadr (getvar "ucsxdir")) (car (getvar "ucsxdir"))))) blk_sca show_unit (getvar "CVPORT") (car e_fml))
				(block_update (entlast) T)
			)
			(T
				(if (not (listp blk_ins)) (setq blk_ins T))
				(if (and (/= (getvar "CVPORT") 2) (not (listp e_fml))) (setq e_fml T))
				(setq what_next 5)
			)
		)
	      )
	      ((= what_next 0)
					(alert "\nRelancez la commande TATOUAGE pour créer un cartouche")
		)
	)
)
(unload_dialog dcl_id)
(vl-load-com)
(if *reactors_record
	(vlr-remove *reactors_record)
)
(setq *reactors_record
	(vlr-editor-reactor
		nil
		'(
			(:vlr-commandwillstart . reactors_record:update)
		)
	)
)
(vlr-remove *reactors_record)
(vlr-command-reactor nil '((:vlr-commandwillstart . reactors_record:update)))
(command "_.undo" "_end")
(if (<= sv_und 3) (command "_.undo" "_control" "_one"))
(setq *error* olderr)
(setvar "cmdecho" 1)
(princ)
)

 

A sauvegarder dans un fichier nommé "Tatouage.dcl" au même endroit que le précédent.

tatouage : dialog {
label = "Création du CARTOUCHE D'ENREGISTREMENT";
:boxed_row {
label = "";
:boxed_column {
label = "Choix de l'échelle";
	:list_box	{
		multiple_select=false;
		key="lst_ech";
		width=10;
	}
	:edit_box {
	label      = "Echelle:";
	mnemonic   = "E";
	key        = "c_ech";
	width = 10;
	edit_width = 10;
	}
	: button {
		label = "associer Fenêtre <";
		mnemonic = "F";
		key = "pick_fmult";                 
	}
	: toggle {
		label = "Verrouiller la vue";
		mnemonic = "V";
		key = "lock_fm";
	}			
}
:column {
:boxed_column {
	label = "Point de Base";
	: button {
		label = "Saisir <";
		mnemonic = "S";
		key = "pick_pt";                 
	}
	: edit_box {
		label = "X:";
		mnemonic = "X";
		key = "x_pt";
		edit_width = 10;
	}
	: edit_box {
		label = "Y:";
		mnemonic = "Y";
		key = "y_pt";
		edit_width = 10;
	}
	: edit_box {
		label = "Z:";
		mnemonic = "Z";
		key = "z_pt";	
		edit_width = 10;
	}
}
:boxed_column {
	label = "Rotation";
	: button {
		label = "Saisir <";
		mnemonic = "S";
		key = "pick_ang";                 
	}
	: edit_box {
		label = "Angle:";
		key = "rotation";
		mnemonic = "A";
		edit_width = 6;
	}
}
}
}
:boxed_row {
	label = "Choix Unité utilisée dans l'espace Objet";
	:radio_button {
		label = "mm";
		key = "b_mm";
	}
	:radio_button {
		label = "cm";
		key = "b_cm";
	}
	:radio_button {
		label = "m ";
		key = "b_m";
	}
	:radio_button {
		label = "km";
		key = "b_km";
	}
}
:boxed_column {
	label = "Renseignement dossier";
	:edit_box {
	label      = "Classement:";
	mnemonic   = "C";
	key        = "c_cla";
	width = 15;
	edit_width = 15;
	}
	:edit_box {
	label      = "Dessinateur:";
	mnemonic   = "D";
	key        = "c_des";
	width = 15;
	edit_width = 15;
	}
}
ok_cancel_err;
}

 

Il ne te reste plus qu'a rajouter ce qui suit dans un fichier à chargement autmatique, exemple:

acad200"n"doc.lsp (Il y en a d'autres...)

(load "tatouage.lsp")
(if s::startup
(setq s::startup (append s::startup '((record))))
(defun-q s::startup () (record))
)

Choisissez un travail que vous aimez et vous n'aurez pas à travailler un seul jour de votre vie. - Confucius

Posté(e)

Bonjour bonuscad,

J’avais omis de te dire merci pour ton programme, c’est très sympa de ta part mais un peu trop compliqué pour moi…

:calim:

Merci quand même.

A bientôt.

 

" Celui qui a déplacé la montagne, c'est celui qui a commencé par enlever les petites pierres "

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é