Hello everybody!
I HAD my VLISP plotting working brilliantly...
Now that we have new plotters, I'm having a little trouble with setting the canonicalmedianame!
I use the two utilities below (cribbed from this site; sorry I seem to have lost the credits) to get the media size. That all works fine, but I'm having trouble setting the papersize to the layout object.
I'm plotting to a PC3 file going to a system printer (Oce TDS450).
This line produces the error:
(vl-catch-all-error-p (vl-catch-all-apply
'vla-put-canonicalmedianame (list TABOBJ PLOTTERPAPERSIZE)))
I have tried the medianame as it comes, UPPER and lower cases, replacing the spaces with underscores (_) to no avail. Does anybody have a clue what I need to do to set the medianame correctly?
This is the media name: "Oce A1 594x841 mm"
Any help would be gratefully received!
Thanks,
Matt
(setq LPAPERSIZE "A1")
(setq PLOTTERPAPERSIZE (WSPCS:GETMEDIASIZE:GLMN LPAPERSIZE))
;;;(WSPCS:GLMN:LIST)
(defun WSPCS:GLMN:LIST (/ GLMN:LIST ACTLAYOUT PLNM)
;; getting cannonical media names
(setq ACTLAYOUT (vla-get-activelayout (WSPCS:ACTIVE-DOCUMENT)))
(vla-refreshplotdeviceinfo ACTLAYOUT)
(setq PLNM (vla-getcanonicalmedianames ACTLAYOUT))
;; list of canonnical media names
(princ (vla-get-configname ACTLAYOUT))
(setq GLMN:LIST '())
(foreach ITM (vlax-safearray->list (vlax-variant-value PLNM))
(setq GLMN:LIST (cons (vla-getlocalemedianame ACTLAYOUT ITM) GLMN:LIST)))
(reverse GLMN:LIST))
;;( WSPCS:GETMEDIASIZE:GLMN "A1")
(defun WSPCS:GETMEDIASIZE:GLMN (PAPERSIZE / MEDIALIST TMEDIASIZE CNTR MEDIASIZE CNTR2)
(setq MEDIALIST (WSPCS:GLMN:LIST)
CNTR 0
CNTR2 CNTR)
(while (< CNTR (length MEDIALIST))
(setq TMEDIASIZE (nth CNTR MEDIALIST))
(if (or (wcmatch (strcase TMEDIASIZE) (strcat "*" "OVERSIZE" "*" PAPERSIZE "*"))
(wcmatch (strcase TMEDIASIZE) (strcat "*" PAPERSIZE "*" "OVERSIZE" "*"))
(wcmatch (strcase TMEDIASIZE) (strcat "*" "EXPAND" "*" PAPERSIZE "*"))
(wcmatch (strcase TMEDIASIZE) (strcat "*" PAPERSIZE "*" "EXPAND" "*")))
(setq MEDIASIZE TMEDIASIZE
CNTR (length MEDIALIST))
(setq CNTR (1+ CNTR))))
(if (not MEDIASIZE)
(while (< CNTR2 (length MEDIALIST))
(setq TMEDIASIZE (nth CNTR2 MEDIALIST))
(if (or (wcmatch (strcase TMEDIASIZE) (strcat "*" PAPERSIZE "*"))
(wcmatch (strcase TMEDIASIZE) (strcat "*" PAPERSIZE "*")))
(setq MEDIASIZE TMEDIASIZE
CNTR2 (length MEDIALIST))
(setq CNTR2 (1+ CNTR2)))))
MEDIASIZE)
Message was edited by: Matt Taylor
Cheers,
-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?