TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: pryzmm on April 02, 2008, 07:58:30 PM
-
;first of all :oops: i apologize for making another tread for this,
;as the one i seek help has not been answered yet, :|,,,anyway
;could anyone take a look at this lisp routine and fix the part where it should "plot",
;basically this supposed to go through a few steps before it invoke the "plot" command.
;but somehow it did'nt and stop with "purge",, im totally newbie into lisp so pls. folks help me,,, :?
;here's the code,,, by the way this is from "allanjt" who contributed most of it,,
;;;-----------------------------
;
(defun c:pizp ( / ss)
(if
(progn
(setvar "filedia" 1) ; Ensure that dialog boxes will be displayed instead of using the command line
(setvar "cmdecho" 0)
(command "-layer" "t" "0" "s" "0" "")
(command "tilemode" "0")
(command "pspace")
(command "zoom" "all")
;;;========================================================================
; Search drawing for images...
(if (setq ss (ssget "X" '((0 . "IMAGE"))))
; If there are images, detach them
(command "-image" "d" "*" )
; If there aren't any images, just spit out a prompt that there aren't any images
(princ "\n There are NO images here...")
)
;;;========================================================================
(command "-purge" "all" "" "n")
(prompt "\nPurging #1")
(command "-purge" "all" "" "n")
(prompt "\nPurging #2")
(prompt "...done")
);progn
(command "plot") [color=red]; it is here that the program stumble, at my end it stop with purging and exit, did not go to "plot", i needed it to be able to show me the plot config, dialogue box or force acad to do that.[/color]
);if
(princ)
)
;;-----------end
;;; with thanks everyone :lol:
;;;excuse mu grammar
-
(initdia) ;add this line
(command "PLOT")
-
Hi pryzmm,
set your plot function as your situation.
(defun c:pizp ( / ss)
(setq tm (getvar "tilemode"))
(if
(= tm 1)
(progn
(setvar "filedia" 1)
(setvar "cmdecho" 0)
(command "-layer" "t" "0" "s" "0" "")
(command "tilemode" "0")
(command "pspace")
(command "zoom" "all")
(if
(setq ss (ssget "X" '((0 . "IMAGE"))))
(command "-image" "d" "*" )
(princ "\nThere are NO images here...")
) ; if
(command "-purge" "all" "" "n")
(prompt "\nPurging #1")
(command "-purge" "all" "" "n")
(prompt "\nPurging #2")
(prompt "...done")
) ; progn
;(command "plot")
(command "-PLOT"
"YES" ; Detailed plot configuration?
"" ; Enter a layout name or [?] <Model>:
"Canon LBP-4" ; Printer type
"A4" ; Paper size
"Millimeters" ; Unit size
"Landscape" ; Model type
"N" ; Plot upside down?
"WINDOW" p1 p2 ; What to plot
"FIT" ; (Plotted Millimeters=Drawing Units) OR [Fit]
"CENTER" ; Enter plot offset (x,y) or [Center]
"YES" ; Plot with plot styles
"MONOCHROME" ; plot style table name
"YES" ; PLOT WITH LIGHWEIGHT
"As displayed" ; SHADE PLOT SETTING
"N" ; Write the plot to a file [Yes/No] <N>:
"Y" ; Save changes to page setup [Yes/No]? <N> y
"Y" ; Proceed with plot [Yes/No] <Y>:
) ; END command
) ; if
(princ)
) ; defun
;first of all :oops: i apologize for making another tread for this,
;as the one i seek help has not been answered yet, :|,,,anyway
;could anyone take a look at this lisp routine and fix the part where it should "plot",
;basically this supposed to go through a few steps before it invoke the "plot" command.
;but somehow it did'nt and stop with "purge",, im totally newbie into lisp so pls. folks help me,,, :?
;here's the code,,, by the way this is from "allanjt" who contributed most of it,,
;;;-----------------------------
;
(defun c:pizp ( / ss)
(if
(progn
(setvar "filedia" 1) ; Ensure that dialog boxes will be displayed instead of using the command line
(setvar "cmdecho" 0)
(command "-layer" "t" "0" "s" "0" "")
(command "tilemode" "0")
(command "pspace")
(command "zoom" "all")
;;;========================================================================
; Search drawing for images...
(if (setq ss (ssget "X" '((0 . "IMAGE"))))
; If there are images, detach them
(command "-image" "d" "*" )
; If there aren't any images, just spit out a prompt that there aren't any images
(princ "\n There are NO images here...")
)
;;;========================================================================
(command "-purge" "all" "" "n")
(prompt "\nPurging #1")
(command "-purge" "all" "" "n")
(prompt "\nPurging #2")
(prompt "...done")
);progn
(command "plot") ; it is here that the program stumble, at my end it stop with purging and exit, did not go to "plot", i needed it to be able to show me the plot config, dialogue box or force acad to do that.
);if
(princ)
)
;;-----------end
;;; with thanks everyone :lol:
;;;excuse mu grammar
-
; kelly---thanks a bunch but sadly it didnt work for me, all it did is hand at the end and when i hit enter it promp me the command line "plot" i needed the "plot dia. box" to show up...
;adesu ----thank you also, but again :oops: i needed the "plot dial. box" to show up. any further suggestions???
thank you
-
Hi pryzmm
Try this
(defun c:pizp ( / ss)
(setvar "filedia" 1) ; Ensure that dialog boxes will be displayed instead of using the command line
(setvar "cmdecho" 0)
(command "-layer" "t" "0" "s" "0" "")
(command "tilemode" "0")
(command "pspace")
(command "zoom" "all")
;;;========================================================================
; Search drawing for images...
(if (setq ss (ssget "X" '((0 . "IMAGE"))))
; If there are images, detach them
(command "-image" "d" "*" )
; If there aren't any images, just spit out a prompt that there aren't any images
(princ "\n There are NO images here...")
)
;;;========================================================================
(command "-purge" "all" "" "n")
(prompt "\nPurging #1")
(command "-purge" "all" "" "n")
(prompt "\nPurging #2")
(prompt "...done")
(initdia)
(command "_.PLOT")
)