woodman78 Posted October 11, 2010 Share Posted October 11, 2010 I have a problem with a field on our template. I have a field for sheet size setup to update automatically based on the printer chosen. It works fine on my machine but on others the field looks fine on screen and when printed on paper. But when creating a pdf it looks fine on screen but the pdf has three dashes where the field should be. This is the lisp, I have included a line to update all fields: ;Based on PageSetups from Alan J. Thompson (defun c:A3-pdf () (PlotReactorOFF) (if (findfile "T:/Drawing Tools/Templates/CCC2009.dwt") (progn (command "_.psetupin" (findfile "T:/Drawing Tools/Templates/CCC2009.dwt") "A3-pdf") (while (wcmatch (getvar "cmdnames") "*PSETUPIN*") (command "_yes") ) ;_ while T ) ;_ progn ) ;_ if (command "-plot" "n" "" "A3-pdf" "" "n" "y" "n") (command "_-purge" "a" "*" "N") (command "updatefield" "all" "") (command "regenall") (command "_zoom" "e") (initdia) (command "._plot") (PlotReactorON) ;(princ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun PlotReactorON nil (vl-load-com) ;; © Lee Mac 2010 ( (lambda ( data foo / react ) (if (setq react (vl-some (function (lambda ( reactor ) (if (eq data (vlr-data reactor)) reactor) ) ) (cdar (vlr-reactors :vlr-command-reactor) ) ) ) (if (not (vlr-added-p react)) (vlr-add react) ) (setq react (vlr-command-reactor data (list (cons :vlr-commandwillstart foo) ) ) ) ) (if (vlr-added-p react) (princ "\n** Reactor Activated **") (princ "\n** Reactor Failed to Activate **") ) react ) "Plot-Reactor" 'Plot-Callback ) (princ) ) (defun PlotReactorOFF nil (vl-load-com) ;; © Lee Mac 2010 ( (lambda ( data foo / react ) (if (setq react (vl-some (function (lambda ( reactor ) (if (eq data (vlr-data reactor)) reactor) ) ) (cdar (vlr-reactors :vlr-command-reactor) ) ) ) (if (vlr-added-p react) (vlr-remove react) ) ) (if (or (not react) (not (vlr-added-p react))) (princ "\n** Reactor Deactivated **") (princ "\n** Reactor Failed to Deactivate **") ) react ) "Plot-Reactor" 'Plot-Callback ) (princ) ) (defun Plot-Callback ( reactor arguments ) (vl-load-com) (if (eq (strcase (car arguments)) "PLOT") (LM:Popup "Warning" 64 "Gotcha!!! Please use the NNRDO Plot tools when plotting standard layouts!!") ) (princ) ) (defun LM:Popup ( title flags msg / WSHShell result ) ;; © Lee Mac 2010 (setq WSHShell (vlax-create-object "WScript.Shell")) (setq result (vlax-invoke WSHShell 'Popup msg 0 title flags)) (vlax-release-object WSHShell) result ) Can anyone help with this? Quote Link to comment Share on other sites More sharing options...
lfe011969 Posted October 11, 2010 Share Posted October 11, 2010 What's the code for your field? Is it just the Plot PageSetupName field? I created a page setup named "A3-pdf" and inserted the Plot PageSetupName field, used your code and when printed it looks like it should. Quote Link to comment Share on other sites More sharing options...
woodman78 Posted October 13, 2010 Author Share Posted October 13, 2010 Thanks anyway but i sorted it by a work-around. I created a variable in the lisp for plotting that set the variable value in cad as a LispVariable. I printed it then as a pdf and it worked fine. Sound. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.