Jump to content

Printing Customization


selvamani

Recommended Posts

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

  • 1 month later...

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:D

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...