selvamani Posted August 30, 2017 Posted August 30, 2017 Hi All, I need help in customizing printing cad files actually in my case single drawing would have multiple sheets in single model space so it will have multiple title block is there any way to print entire region inside title block one by one by means of vba scripting? (i mean is there any way to sense outer boundary of title block in vb and set it as printing area) Having thousands of cad files in which work area in model space of any two drawing is not same thanks in advance Drawing2.dwg Quote
maratovich Posted August 30, 2017 Posted August 30, 2017 (edited) It's not a problem. There is a program for printing from the model - "Revers" https://www.kdmsoft.net/revers.html Edited December 21, 2017 by maratovich Quote
BIGAL Posted August 31, 2017 Posted August 31, 2017 Here is a lisp for printing all title blocks in model space you will need to change the block name and some of the size values to suit, you will need to change destination printer name and Ctb name. ; plot all title blocks in model space ; By Alan H (PROMPT ".....PRINTING DRAWING TO plotter....") (setq oldsnap (getvar "osmode")) (setvar "osmode" 0) : Da1drsht is titel block name (setq ss2 (ssget "x" '((0 . "INSERT")(2 . "Da1drsht")(410 . "Model")))) (setq n (sslength ss2)) (setq index 0) (repeat n (setq en (ssname ss2 index)) (setq el (entget en)) (setq inspt (assoc 10 el)) ; insertion pt this is lower left for this code (setq xmin (- (cadr inspt) 6.0)) (setq ymin (- (caddr inspt) 6.0)) (setq xymin (strcat (rtos xmin 2 1) "," (rtos ymin 2 1))) (setq xmax (+ xmin 813.0)) ; hard coded for 813 wide 6mm offset (setq ymax (+ ymin 566.0)) ;hard code for 566 high (setq xymax (strcat (rtos xmax 2 1) "," (rtos ymax 2 1))) (COMMAND "-PLOT" "Y" "" "//PRODPRN01/Design-5100" "A3" "M" "LANDSCAPE" "N" "W" xymin xymax "1=2" "C" "y" "Designlaser.ctb" "Y" "" "n" "n" "y" ) (setq index (+ index 1)) ) (setvar "osmode" oldsnap) (princ) Quote
selvamani Posted October 25, 2017 Author Posted October 25, 2017 Thanks bigal, Your Lisp code is awesome & because of more functional requirements we made it in VBA and used GetBoundingBox Method to get boundary of a title block :D Quote
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.