AutoCAD - Francais

AutoCAD - Francais

Répondre
Active Contributor
delium55
Envois : 39
Inscrit : ‎03-03-2005
Message 1 sur 3 (229 visites)

fenêtre espace papier vs esp. objet

229 Visites, 2 Réponses
01-26-2006 05:42 PM
J'ai internationnalisé les commandes de ce lisp mais à l'usage j'ai un message d'erreur: paramètre de la variable Autocad rejeté: "cvport" 2.

Ou est le problème.

Merçi de votre aide.

François.

Voiçi le lisp;

;Tip1687: VPLIM.LSP Pspace Limits in Mspace (c)2001, Murray Clack

;VPLIM.lsp draws the limits of a Paperspace Viewport Boundary in MODELSPACE
;VP - Get ViewPort object
;HT - Get Outside HeighT of Viewport
;WD - Get Oustide WiDth of Viewport
;VN - Get Viewport Number
;CTR - Get CenTeR of Viewport
;CTRX - Caluculate X of Viewport CenTeR
;CTRY - Caluculate Y of Viewport CenTeR
;VS - Get View Size of viewport
;XP - Calculate XP factor of viewport
;IW - Calculate Width of viewport
;BL - Calculate Bottom Left corner of viewport
;BR - Calculate Bottom Right corner of viewport
;TR - Calculate Top Right corner of viewport
;TL - Calculate Top Left corner of viewport
;PW - Save PlineWid
;OS - Save OSmode



;start function and define variables
(defun
C:VPL
(/ VP HT WD VN CTR CTRX CTRY VS XP IW BL BR TR TL PW OS)

;turn off command echoing
(setvar "cmdecho" 0)

;save current layer as "clay"
(setq clay (getvar 'clayer))

;make current layer defpoints
(command "_.layer" "_m" "_Defpoints" "")

;enter pspace
(command "._pspace")

;select viewport boundary
(setq VP
(entget
(car

(entsel
"\nSélectionnez fenêtre esp. papier pour dessiner contour limite dans esp. objet"

) ;_ end of entsel
) ;_ end of car
) ;_ end of entget
) ;_ end of setq

;Get Viewport height with
(setq HT (cdr (assoc 41 VP)))

;Get Viewport width with
(setq WD (cdr (assoc 40 VP)))

;Get Viewport Number
(setq VN (cdr (assoc 69 VP)))

;enter mspace
(command "._mspace")

;set correct viewport
(setvar "_cvport" VN)

;set UCS to View
(command "._ucs" "v")

;Get VIEWCTR store as CTR
(setq CTR (getvar "viewctr"))

;Get X of CTR
(setq CTRX (car CTR))

;Get Y of CTR
(setq CTRY (cadr CTR))

;Get inside Viewport height
(setq VS (getvar "viewsize"))

;Get XP Factor with HeighT / View Size
(setq XP (/ HT VS))

;Get inside width of Viewport by
(setq IW (* (/ VS HT) WD))

;Find four corners of Viewport
(setq BL (list (- CTRX (/ IW 2)) (- CTRY (/ VS 2))))

(setq BR (list (+ CTRX (/ IW 2)) (- CTRY (/ VS 2))))

(setq TR (list (+ CTRX (/ IW 2)) (+ CTRY (/ VS 2))))

(setq TL (list (- CTRX (/ IW 2)) (+ CTRY (/ VS 2))))

;Save current pline width
(setq PW (getvar "plinewid"))

;Set Pline width to zero
(setvar "plinewid" 0)

;Save current osmode
(setq OS (getvar "osmode"))

;Draw pline inside border
(command "._pline" BL BR TR TL "_c")

;Restore pline width back
(setvar "plinewid" PW)

;Restore UCS back
(command "._ucs" "_p")

;Restore osmode
(setvar "osmode" OS)

;Restore curernt layer
(setvar "clayer" clay)

;Clean up command prompt
(princ)

;Go Back To Papserspace
(command "._pspace")

) ;The End!
Distinguished Contributor
bruno.valsecchi
Envois : 584
Inscrit : ‎05-05-2004
Message 2 sur 3 (229 visites)

Re: fenêtre espace papier vs esp. objet

01-27-2006 02:20 AM en réponse à : delium55
Tu en as trop fait lors de l'internationnalisation!

ceci n'est pas correct :smileysad:setvar "_cvport" VN)
Les noms de variables reste en anglais sans underscore

(setvar "cvport" VN) fonctionnera mieux :smileywink:
Active Contributor
delium55
Envois : 39
Inscrit : ‎03-03-2005
Message 3 sur 3 (229 visites)

Re: fenêtre espace papier vs esp. objet

01-27-2006 05:33 AM en réponse à : delium55
Merçi Bruno,

Une erreur de débutant en lisp, effectivement ce n'est pas une commande.

Salutations,

François.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Annonces
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.