Compatibilite lisp AtoCAD 2013 [Fermé]

Signaler
Messages postés
2
Date d'inscription
samedi 31 mai 2014
Statut
Membre
Dernière intervention
31 mai 2014
-
Bonjour,

j'utilse un fchier lisp avec AutoCAD 2013 qui marche a merveille sur mon PC perso. c'est un lisp qui rempli des blocs attribut autoCAD grace à une base de donnes ecrite en WinDEV.

Mon probleme est que ce fichier lisp ne fonctionne pas du tout sur mon poste de travail au boulot, alors que je travaille egalement sur AutoCAD 2013 et le meme logiciel Windev.

Est ce que quelqu'un aurai une petite idée de mon probleme?

Si dessous, le fichier lisp en question:

"; --------------------------------------------------------------------------;
;programme matos poste fev. 1999
; --------------------------------------------------------------------------;
; --------------------------------------------------------------------------;
; --------------------------------------------------------------------------;
;(setq support (getstring "\npoteau travaux:"))
(princ "*")(terpri)
(princ "*")(terpri)
;(setq toto (getstring "\attention materiel FRANCE:"))

; --------------------------------------------------------------------------;
(defun c:matve()
;(command "modifvar" "blipmode" "0" "modifvar" "cmdecho" "0" )
(set 'directo "Y:/be_cat00/poste/source/") ;initial directorie prog.

(set 'directofi "Y:/be_cat00/") ;initial directorie prog.

(set 'blmat (strcat directo "l-mat4.dwg")) ;bloc ligne de matos
(set 'blmatapp (strcat directo "l-mat-app.dwg")) ;bloc ligne de matos ref.
(setq fich (strcat directofi "BasePoste_SF1104.txt"));::::::::::::::::::::::SF1104
;(setq fich (getfiled "Fichier données" directo "TXT" 8))
(setq f (open fich "r")) ;fichier données
(set 'planrch "");plan recherché
(set 'reprch "") ;repére recherché
(if (= support nil)(set 'support ""));numero support
(set 'rechsym "");symb recherché
(set 'FQTX "1")


;-------------


(setq dcl_id (load_dialog (strcat directo "mat_post.dcl")))
(if (not (new_dialog "mat_post"dcl_id))
(exit)
)



(set_tile "numsup" support)
(set_tile "plan" planrch)
(set_tile "rep" reprch)
(set_tile "rechsym" rechsym)
(set_tile "FQTX" FQTX)
(action_tile "numsup" "(setq support $value)")
(action_tile "plan" "(setq planrch $value)")
(action_tile "rep" "(setq reprch $value)")
(action_tile "FQTX" "(setq fqtx $value)")
(action_tile "rechsym" "(setq rechsym $value)")
;(action_tile "accept" "(check_string_length selection_list)")
(start_dialog)
;-------------

;(setq rechsym (getstring "\nsymbole appel recherche:"))
;(setq fqtx (getint "\n multiplicateur:"))
;(setq support (getstring "\n poteau : "))

;(while (null eof)
(setq ens "vide")
(setq trouve 0)
(setq ligne "vide")

(while (and (/= ligne nil) (= trouve 0) ) ;tantque ligne <> null et trouve = 0

(setq ligne (read-line f)) ;lecture de la ligne

;extraction des parties


(setq ens (substr ligne 1 3))
(setq acad (substr ligne 4 1))
(setq nom (substr ligne 5 3))
(setq qt (substr ligne 6 7))
(setq fin (substr qt (strlen qt) 1))
(while (= fin " ")
(setq qt (substr qt 1 (1- (strlen qt))))
;(princ "milieu *")(princ fin)(princ "* symb ")(princ sym)(princ "*qt : ")(princ qt)(terpri)
(setq fin (substr qt (strlen qt) 1))
)
(setq qt2 (substr ligne 13 7))
(setq fin (substr qt2 (strlen qt2) 1))
(while (= fin " ")
(setq qt2 (substr qt2 1 (1- (strlen qt2))))
(setq fin (substr qt2 (strlen qt2) 1))
;(princ "fin *")(princ fin)(princ "* symb ")(princ sym)(princ "*qt2 : ")(princ qt2)(terpri)
)
(setq sym (substr ligne 20 8))

(setq fin (substr sym (strlen sym) 1))
(while (= fin " ")
(setq sym (substr sym 1 (1- (strlen sym))))
(setq fin (substr sym (strlen sym) 1))
)
(setq four (substr ligne 28 1))
(setq dos (substr ligne 29 5))
(setq plan (substr ligne 34 6))
(setq rep (substr ligne 40 6))
(setq libacad (substr ligne 46))



;(princ sym)(princ "*")(princ rechsym)(princ "*")(terpri)


(if (= rechsym "")
(progn
(if (= ens "2 ")
(progn
(if (= plan planrch)
(progn
(if (= rep reprch)
(progn
(setq trouve 1)
(ecrit)
)
)
)
)
)
)
)

(progn

(if (= ens "2 ")
(progn
(if (= sym rechsym)
(progn
(setq trouve 1)
(ecrit)
)
)
)
)
)

)
)
(if (= trouve 0)
(alert "--------------------------- ENSEMBLE NON TROUVE -----------------------------")
)
)
; --------------------------------------------------------------------------;
; --------------------------------------------------------------------------;
;---------------------------------------------------
(defun ecrit()
(setq mesaccr (getvar "osmode" ));SAUVE ACCROCHE OBJET
(command "accrobj" "_none")

(setq insertt (getpoint "pointer point depart haut"))
(setq ens "vide")

(set 'compplan (strcat dos "/" plan "/" rep))
(command "inserer" blmatapp insertt 1.0 1.0 0.0 fqtx qt2 libacad support sym)
;(princ "* qt2 du symbole d appel ")(princ qt2)(princ "*")(terpri)
(setq DEBUTTRAIT (polar insertt (convdeg -90) 250) )
(setq DEBUTTRAIT (polar DEBUTTRAIT (convdeg -180) 350) )
(while (AND (/= ens "2 ") (/= LIGNE nil))

(setq ligne (read-line f)) ;lecture de la ligne

(if (/= LIGNE nil)
(progn
(setq ens (substr ligne 1 3))
(setq acad (substr ligne 4 1))
(setq nom (substr ligne 5 3))
(setq qt (substr ligne 6 7))
(setq fin (substr qt (strlen qt) 1))
;(while (= fin " ")
; (setq qt (substr qt 1 (1- (strlen qt))))
; (setq fin (substr qt (1- (strlen qt)) 1))
;)
(setq qt2 (substr ligne 13 7))
(setq fin (substr qt2 (strlen qt2) 1))
;(while (= fin " ")
; (setq qt2 (substr qt2 1 (1- (strlen qt))))
; (setq fin (substr qt2 (1- (strlen qt)) 1))
; (princ "fin *")(princ fin)(princ "* symb ")(princ sym)(princ "*qt2 : ")(princ qt2)(terpri)
;)
(setq sym (substr ligne 20 8))
(setq four (substr ligne 28 1))
(setq dos (substr ligne 29 5))
(setq plan (substr ligne 34 6))
(setq rep (substr ligne 40 6))
(setq libacad (substr ligne 46))
(if (and (/= libacad "")(/= ens "2 ")(= acad "1") )
(progn
(setq insertt (polar insertt (convdeg 90) -350) )
(if (and (/= plan "******") (/= plan " ") (/= rep "******"))
(progn
(setq zer (substr plan 1 1))
(if (= zer "0")
(progn
(setq i1 1)
(while (= zer "0")
(setq zer (substr plan i1 1))
(setq i1 (+ i1 1))
)
(setq i2 (- i1 1))
(setq plan (substr plan i2 (- 6 (- i2 1))))
)
)
(if (or (= rep "000000") (= rep " ")) (set 'compplan (strcat dos "/" plan))
(progn
(setq zer1 (substr rep 1 1))
(if (= zer1 "0")
(progn
(setq i3 1)
(while (= zer1 "0")
(setq zer1 (substr rep i3 1))
(setq i3 (+ i3 1))
)
(setq i4 (- i3 1))
(setq rep (substr rep i4 (- 6 (- i4 1))))
)
)
(set 'compplan (strcat dos "/" plan " Rep:" rep))
)
)
)
(setq compplan "")
)
;(if (= rep "000000") (set 'compplan (strcat dos "/" plan))
; (set 'compplan (strcat dos "/" plan "/" rep)))
;(if (= compplan "//") (setq compplan "") )
;(if (= compplan "*****/******/******") (setq compplan "") )
(command "inserer" blmat insertt 1.0 1.0 0.0 fqtx compplan qt2 libacad support "00000000")
(if (= compplan "") (setq insertt (polar insertt (convdeg -90) -170) ) )
;(PRINC plan)(PRINC "*")(PRINC rep)(PRINC "*")(PRINC libacad)(PRINC "*")(terpri)
)
)
)
)

)
(setq FINTRAIT (polar insertt (convdeg 90) -250) )
(setq FINTRAIT (polar FINTRAIT (convdeg -180) 350) )
(setq FINTRAITH (polar FINTRAIT (convdeg -180) -3250) )
(Command "_LAYER" "CH" "1" "")
(command "LIGNE" DEBUTTRAIT FINTRAIT "")
(command "LIGNE" FINTRAIT FINTRAITH "")
(setvar "osmode" mesaccr );RESTITUE ACCROCHE OBJET
)
; --------------------------------------------------------------------------;
;---------------------------------------------------
(defun convdeg(a) ;conversion degres vers radian
(* PI (/ a 180.))
)
;---------------------------------------------------
; --------------------------------------------------------------------------;
;---------------------------------------------------
;---------------------------------------------------
;---------------------------------------------------

"