Burzum Posted December 12, 2022 Posted December 12, 2022 Hi I'm searching for a lisp. I got many drawings where the blocks bacground colour is black. In real the colour is white. See below, on the write site, background colour is black, I want all hatch background colour white. Is there any Lisp that can change the colour? Quote
BIGAL Posted December 13, 2022 Posted December 13, 2022 Are you sure the background color is just a see through color when printing, if you make the infill white it will print as Black. Do you want no color maybe redo the block and use wipeout. Post a dwg so can see what is going on. 1 Quote
Burzum Posted December 13, 2022 Author Posted December 13, 2022 thanks for the reply, I attached the dwg file. I always get such dwg files with those blockes. All blockes are black I need the background colour white and I dont know any solution, so I must change them one by one. It takes so much time. block-problem.dwg Quote
ronjonp Posted December 13, 2022 Posted December 13, 2022 (edited) This will changes hatches within block definitions to truecolor 255,255,255. (defun c:foo (/ a co d) ;; RJP » 2022-12-13 (vlax-for l (vla-get-layers (setq d (vla-get-activedocument (vlax-get-acad-object)))) (cond ((= -1 (vlax-get l 'lock)) (vlax-put l 'lock 0) (setq a (cons l a)))) ) (vlax-for b (vla-get-blocks d) (if (= 0 (vlax-get b 'isxref) (vlax-get b 'islayout)) (vlax-for o b (or co (vla-setrgb (setq co (vla-get-truecolor o)) 255 255 255)) (if (and (vlax-write-enabled-p o) (wcmatch (vla-get-objectname o) "AcDbHatch") (= 7 (vla-get-color o)) ) (vla-put-truecolor o co) ) ) ) ) (foreach l a (vlax-put l 'lock -1)) (vla-regen d acallviewports) (princ) ) Edited December 13, 2022 by ronjonp Quote
Burzum Posted December 13, 2022 Author Posted December 13, 2022 (edited) Hi ronjonp, this code changes all hatch colours to 255,255,255 but I want only the black hatch colour 7 change into 255,255,255. How can I change this code ? I have attached a photo. At the moment the hatches in the block are black, but I want it white like on the left side Edited December 13, 2022 by Burzum Quote
ronjonp Posted December 13, 2022 Posted December 13, 2022 (edited) 41 minutes ago, Burzum said: Hi ronjonp, this code changes all hatch colours to 255,255,255 but I want only the black hatch colour 7 change into 255,255,255. How can I change this code ? I have attached a photo. At the moment the hatches in the block are black, but I want it white like on the left side @Burzum I updated the code above. Edited December 13, 2022 by ronjonp Quote
Burzum Posted December 13, 2022 Author Posted December 13, 2022 (edited) 53 minutes ago, ronjonp said: @Burzum I updated the code above. thanks you it works greate a little bit wish, is it possible to set the changed hatches into the background? some blocks have the hatches in the front so the numbers in the blocks are not visible I tried with the command Hatchtoback but its not working for blocks, I must edit every block Edited December 13, 2022 by Burzum Quote
ronjonp Posted December 13, 2022 Posted December 13, 2022 46 minutes ago, Burzum said: thanks you it works greate a little bit wish, is it possible to set the changed hatches into the background? some blocks have the hatches in the front so the numbers in the blocks are not visible I tried with the command Hatchtoback but its not working for blocks, I must edit every block See if you can implement THIS into the code. I have 'real' work to do ATM. 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.