Jump to content

Recommended Posts

Posted

Hi I'm using 2008 and need to print to my adobe printer to achieve a black and white pdf.

This is normally easy using .ctb files but I have colours of true colour RGB values which cannot be addressed by a .ctb. It has been suggested that I use an .stb but this has proved successful for one drawing (with a bit of tinkering) but as I need to pdf over 200 drawing this is going to be too messy/error prone,time consuming. I finally had the brainwave i saving the drawing, once emptied, as'host.dwg' and importing eachdrawing individually but that only partiallly worked.

It has also been suggested that by best hope is a lisp that will change the colour of all the entities in a drawing, ideally with one click so that I do not lose my place in the sequence but the drawings include blocks, mtext etc and I really want to maintain their status without exploding anything.

 

any ideas ? the lisps here seem to partially address my problem.

Moderator, please accept my apologies and move this message if you feel I have 'piggybacked' a thread.

 

thanks

Posted

Moderator, please accept my apologies and move this message if you feel I have 'piggybacked' a thread.

 

thanks

 

Since you don't say that the lisps in that thread do what you want to, I have moved your question to it's own thread - with a link in the edit-note.

Posted
(vlax-for x (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
 (vla-put-color x 7))

[color=Red]OR[/color]

(command "_.-layer" "_color" 7 "*" "")

Not what I would suggest, though.

Posted

Or perhaps:

 

(defun c:All2White (/ ss lLst)
 (vl-load-com)

 (vla-StartUndoMark
   (setq *doc
     (cond ((vla-get-ActiveDocument
              (vlax-get-acad-object))))))

 (vlax-for lay (vla-get-Layers *doc)
   
   (and (eq :vlax-true (vla-get-lock lay))
        (setq lLst (cons lay lLst))
        (vla-put-lock lay :vlax-false))
   
   (vla-put-color lay 7))

 (if (ssget "_X" '((-4 . "<NOT") (62 . 256) (-4 . "NOT>")))
   (progn
     (vlax-for obj (setq ss (vla-get-ActiveSelectionSet *doc))
       (vla-put-Color obj acByLayer))
     (vla-delete ss)))

 (vlax-for blk (vla-get-blocks *doc)
   (vlax-for obj blk
     (vla-put-color obj acByLayer)))

 (vl-cmdf "_.attsync" "_n" "*")

 (mapcar
   (function
     (lambda (layer) (vla-put-lock layer :vlax-true))) lLst)

 (vla-EndUndoMark *doc)
 (princ))

 

But again, not ideal.

 

EDIT: Updated.

Posted

Yeah, mine wasn't nearly complete. I wasn't worrying with object level changes.

Nice work. :)

However, I hope this isn't the path taken.

Or perhaps:

 

(defun c:All2White (/ ss lLst)
 (vl-load-com)

 (vla-StartUndoMark
   (setq *doc
     (cond ((vla-get-ActiveDocument
              (vlax-get-acad-object))))))

 (vlax-for lay (vla-get-Layers *doc)
   
   (and (eq :vlax-true (vla-get-lock lay))
        (setq lLst (cons lay lLst))
        (vla-put-lock lay :vlax-false))
   
   (vla-put-color lay 7))

 (if (ssget "_X" '((-4 . "<NOT") (62 . 256) (-4 . "NOT>")))
   (progn
     (vlax-for obj (setq ss (vla-get-ActiveSelectionSet *doc))
       (vla-put-Color obj acByLayer))
     (vla-delete ss)))

 (vlax-for blk (vla-get-blocks *doc)
   (vlax-for obj blk
     (vla-put-color obj acByLayer)))

 (vl-cmdf "_.attsync" "_n" "*")

 (mapcar
   (function
     (lambda (layer) (vla-put-lock layer :vlax-true))) lLst)

 (vla-EndUndoMark *doc)
 (princ))

But again, not ideal.

 

EDIT: Updated.

Posted

in reply to your first question Lee, I probably need everything changed to a colour, (probably any colour but say 7) it doesn't matter too much as the final intent is to generate a mono pdf that the users can look at.

 

Alan JT..... 'However, I hope this isn't the path taken'....

what does that mean?

 

thanks for your efforts to date...

Posted

 

Alan JT..... 'However, I hope this isn't the path taken'....

what does that mean?

.

 

Well, the methods we have suggested thus far in our codes mean changing the colours for all the layers and changing block definitions etc - which is not ideal as it means tampering with the drawing.

Posted
in reply to your first question Lee, I probably need everything changed to a colour, (probably any colour but say 7) it doesn't matter too much as the final intent is to generate a mono pdf that the users can look at.

 

Alan JT..... 'However, I hope this isn't the path taken'....

what does that mean?

 

thanks for your efforts to date...

 

Just that you would be changing quite a bit and ruining a drawing. Hopefully, if you go this route, you will make a copy of the DWG's beforehand.

 

You can choose any color. Lee and I both went with 7 because it's the default color.

Posted

In that case its just the job, As you suggest I will be working on copies anyway. The mono pdf is my sole target. I'm snowed under with work today but as soon as I get a chance to try it I'll let you both know but ,again, thanks for you efforts.

 

heres hoping

 

:):):)

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