Author Topic: Urgently seeking help !!! ( not the best Subject: line I've ever seen )  (Read 2146 times)

0 Members and 1 Guest are viewing this topic.

pryzmm

  • Guest
;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,,
Code: [Select]
;;;-----------------------------
;
(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
« Last Edit: April 04, 2008, 07:03:06 AM by Mark Thomas »

FengK

  • Guest
Re: Urgently seeking help !!!
« Reply #1 on: April 02, 2008, 08:21:30 PM »
(initdia) ;add this line
(command "PLOT")

Adesu

  • Guest
Re: Urgently seeking help !!!
« Reply #2 on: April 02, 2008, 11:39:54 PM »
Hi pryzmm,
set your plot function as your situation.
Code: [Select]
(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

pryzmm

  • Guest
Re: Urgently seeking help !!!
« Reply #3 on: April 03, 2008, 12:10:33 AM »
; 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 

Willie

  • Swamp Rat
  • Posts: 958
  • Going nowhere slowly
Re: Urgently seeking help !!!
« Reply #4 on: April 03, 2008, 12:40:42 AM »
Hi pryzmm

Try this

Code: [Select]
(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")

)
Soli Deo Gloria | Qui Audet Adipiscitur
Windows 8  64-bit Enterprise | Civil 3D 2015 and 2016| ArcGIS 10.1
Yogi Berra : "I'd give my right arm to be ambidextrous."