Jump to content

Load CUI and All Pull Down Menus with lisp


DaveC

Recommended Posts

I need some help in the following lisp, I changing the CAD Plot log adding extra info that I need like the project number and a Flag and sorting in a different way.

the problem is that if a have many plot cad files the changes are correct, but if I have only ONE file printed no changes occur, I creating a new plot log file avery time I plot, 

 and I copy that information to another file.

 

any help will be really appreciated, thank so much.

 

 

(SETQ p_Number "9999999")
(SETQ Xcopies "1")
(setq Flag "----")


;; USING THE DOSLIB_9.02 BY R. McNeel
(setq File2Read (dos_readdelimitedfile "C:/Temp/AutoCad-PlotInfo.log"))   ;;  << the original Plot Log File

   ;;; (("U:\\100000\\elec\\765471 E-001-00 Ver01.dwg" "42X30" "8/24/2018 9:14:37 AM" "USERNAME" "Oce_TDS750_12th.pc3" "Oce B+ 12x18 in (Landscape)" "1:1.00011" nil)
    ;;;  ("U:\\100000\\elec\\765471 E-001-00 Ver02.dwg" "42X30" "8/24/2018 10:30:33 AM" "USERNAME" "DWG To PDF.pc3" "ARCH B - (18.00 x 12.00 Inches)" "1:1.00011" nil)
    ;;;  ("U:\\100000\\elec\\765471 E-001-00 Ver03.dwg" "42X30" "8/24/2018 11:02:49 AM" "USERNAME" "DWG To PDF.pc3" "ARCH B - (18.00 x 12.00 Inches)" "1:1.00011" nil)

  ;;; )


 (setq Xlines (length File2Read))
(setq Index 0)

 

(while (> Xlines 0)
        (setq XRow (nth index File2Read))

       ;; ;  ("U:\\100000\\elec\\765471 E-001-00 Ver01.dwg" "42X30" "8/24/2018 9:14:37 AM" "USERNAME" "Oce_TDS750_12th.pc3" "Oce B+ 12x18 in (Landscape)" "1:1.00011" nil)


        (setq DrwgName (nth 0 XRow))
        (setq TabPrint(nth 1 XRow))
        (setq Plot_date (nth 2 XRow))
        (setq User_name (nth 3 XRow))
        (setq PlotterName (nth 4 XRow))
        (setq PaperSize (nth 5 XRow))
       (setq datestr (itoa (fix (getvar 'cdate))) ; string in YYYYMMDD format
                 XMonthstr (substr datestr 5 2) ; month number as string
                XYearstr (substr datestr 1 4) ; year
               PlotDataFolder "c:/temp/"
       )
       (setq FileOpen (open (setq filestr (strcat PlotDataFolder XYearstr "-" XMonthstr " " "PlotInfo.log"))  ;; << the new Plot Log File
                                         (if (findfile filestr) "a" "w" )
                                  ); open
       ); setq
      (if (or (= PlotterName "Oce_TDS750_11th.pc3")
                  (= PlotterName "Oce_TDS750_12th.pc3")
                  (= PlotterName "HP_T2500-Color_Plotter Plan Desk.pc3")
          )
          (PROGN
                (write-line (strcat plot_date ", " p_Number ", " DrwgName ", " user_name ", " PlotterName ", "
                                                                   PaperSize ", " Xcopies ", " Flag) FileOpen
                ) ; write-line
                (close FileOpen)
          )
         (princ "\ No entry required \n")
    ) ; IF
   (setq Xlines (1- Xlines))
   (setq index (+ index 1))
) ; while

 

 

Thank you.... DC

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...