Plotting through Core console on 2024 civil 3d
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Edit:
I have since updated the script to have it working in the 2022 version of Civil 3d. However am having issues making it work on the 2024 version. Upon entering the script lines manually in 2024 it seems to work... any ideas please shoot me a response? The new script is below
Hello all
trying to make a script which I can run with core console to plot drawings through cre console by passing the need to open each drawing and close like publish.
At the moment the script works for single layout drawings IE 1 paper space layout and will PDF the drawings. However I want to make it so that the script will pick up that there is 2 layouts in a drawing and pdf them with the naming convention the layout has.
if you have any ideas can you reach out:? script is below
;;---------=={ A1 SAP STD Draft Plot Script }==------------;;
;; ;;
;; Prints to pdf the current drawing by using the ;;
;; drawing name and layout tab value to create the ;;
;; file name. Saves the PDF to the folder listed below: ;;
;; "U:\\pdf location\\" ;;
;; ;;
;;------------------------------------------------------------;;
;; Author: Faisal D ;;
;;------------------------------------------------------------;;
;; Version 2.0 - 17-01-2024 ;;
;;------------------------------------------------------------;;
;;------------------------------------------------------------;;
;; File Name Variables
;;----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------;
(setvar "filedia" 0)
(command "cmdecho" "1")
(command "TILEMODE" "0" "PDMODE" "0" "ZOOM" "E" "-OSNAP" "NONE" "wipeout" "f" "off" "TEXTFILL" "1" "REGENALL");command
(setq PDF_PATH "U:\\pdf location\\")
(if (not (vl-file-directory-p PDF_PATH))
(vl-mkdir PDF_PATH))
;;-----------------------------------------------------------------------------------------------------------------------;
;; Start FOREACH loop to run through all layout tabs
;;-----------------------------------------------------------------------------------------------------------------------;
(foreach layoutname
(
(lambda ( dict / def l n )
(while (setq def (dictnext dict (null def)))
(if (not (eq "MODEL" (strcase (setq n (cdr (assoc 1 (reverse def)))))))
(setq l (cons n l))
)
)
(reverse l)
)
(cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_LAYOUT")))
)
(setvar "ctab" layoutname)
;;-----------------------------------------------------------------------------------------------------------------------;
;; Start of PLOTS SETTINGS FOR A1 PDF IN COLOUR - SAP
;;-----------------------------------------------------------------------------------------------------------------------;
(command "-PLOT"
;Detailed plot configuration? [Yes/No] <No>:
"yes"
;Enter a layout name or [?] <Layout1>:
""
;Enter an output device name or [?] <AutoCAD PDF (General Documentation).pc3>:
"DWG To PDF.pc3"
;Enter paper size or [?] <ISO A4 (210.00 x 297.00 MM)>:
"ISO full bleed A1 (841.00 x 594.00 MM)"
;Enter paper units [Inches/Millimeters] <Millimeters>:
"Millimeters"
;Enter drawing orientation [Portrait/Landscape] <Portrait>:
"Landscape"
;Plot upside down? [Yes/No] <No>:
"No"
;Enter plot area [Display/Extents/Layout/View/Window] <Layout>:
"Extents"
;Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <1:1>:
"1:1"
;Enter plot offset (x,y) or [Center] <0.00,0.00>:
;"0.00,0.00"
"Center"
;Plot with plot styles? [Yes/No] <Yes>:
"yes"
;Enter plot style table name or [?] (enter . for none) <>:
"SAP_A1-A3.ctb"
;Plot with lineweights? [Yes/No] <Yes>:
"yes"
;Scale lineweights with plot scale? [Yes/No] <No>:
"no"
;Plot paper space first? [Yes/No] <No>:
"no"
;Hide paperspace objects? [Yes/No] <No>:
"no"
;name of plot file
(strcat PDF_PATH layoutname ".pdf")
;Save changes to page setup [Yes/No]? <N>:
"N"
;Proceed with plot [Yes/No] <Y>:
"Yes"
;Effective plotting area: 841.00 wide by 594.00 high
;Plotting viewport 1
);command
;;-----------------------------------------------------------------------------------------------------------------------;
;; Ends the for each loop
;;-----------------------------------------------------------------------------------------------------------------------;
);; Ends the for each loop
;;-----------------------------------------------------------------------------------------------------------------------;
;; END OF PLOT SETTINGS FOR A1 PDF IN COLOUR - SAP
;;-----------------------------------------------------------------------------------------------------------------------;
(setvar "filedia" 1)
(prompt (strcat "\n:: PDF saves in " PDF_PATH " | \\U+00A9 Faisal D " (menucmd "m=$(edtime,0,yyyy)") " ::\n"))