marko_ribar Posted March 29, 2014 Share Posted March 29, 2014 Hello all, I know that circle entity can be converted to wipeout polygon via ALISP routine you can find on http://www.lee-mac.com... How can we create wipeout with hole inside, or better can we convert hatches to wipeouts? Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted March 29, 2014 Author Share Posted March 29, 2014 It seems that this is only solution... Look here... But my CAD Background is almost black, and white color is plotted as black, but color 255,255,255 which is also white is plotted like mask... I can't differentiate between white or black unless I don't change CAD Background color and white Background tires my eyes while working... So can this 255,255,255 color be set while plotting as white (paper is white) and in CAD environment to be seen as black 0,0,0... Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted March 30, 2014 Author Share Posted March 30, 2014 (edited) I've solved this problem successfully with this simple piece of code... Hope it will help and others as it helps me... I've put it into my startup suite... (defun c:bhwipeout ( / adoc True->RGB ss i orlay lay bckmodcol rgb bound ) (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (defun True->RGB ( c ) (mapcar '(lambda ( x ) (lsh (lsh (fix c) x) -24)) '(8 16 24)) ) (setq orlay (getvar 'clayer)) (if (not (tblsearch "LAYER" "HATCH-WIPEOUT")) (setq lay (vla-add (vla-get-layers adoc) "HATCH-WIPEOUT")) (setq lay (vla-item (vla-get-layers adoc) "HATCH-WIPEOUT")) ) (vla-put-plottable lay :vlax-false) (setq bckmodcol (vlax-variant-value (vlax-variant-change-type (vla-get-graphicswinmodelbackgrndcolor (vla-get-display (vla-get-preferences (vlax-get-acad-object)))) vlax-vbstring))) (setq rgb (reverse (true->rgb (atoi bckmodcol)))) (command "_.layer" "_S" "HATCH-WIPEOUT" "_C" "_T" (strcat (itoa (car rgb)) "," (itoa (cadr rgb)) "," (itoa (caddr rgb))) "" "") (setvar 'clayer orlay) (setvar 'hpname "SOLID") (prompt "\nSelect boundary entities for wipeout hatches") (setq ss (ssget (append (list '(-4 . "<or") '(0 . "CIRCLE") '(-4 . "<and") '(0 . "*POLYLINE") '(-4 . "<not") '(-4 . "&=") '(70 . '(-4 . "not>") '(-4 . "&=") '(70 . 1) '(-4 . "and>") '(-4 . "<and") '(0 . "SPLINE") '(-4 . "&=") '(70 . 1) '(-4 . "and>") '(-4 . "<and") '(0 . "ELLIPSE") '(41 . 0.0)) (list (cons 42 (* 2 pi))) (list '(-4 . "and>") '(0 . "REGION") '(-4 . "or>"))))) (setq i -1) (while (setq bound (ssname ss (setq i (1+ i)))) (if (>= (atof (substr (getvar "acadver") 1 4)) 18.0) (setvar 'hpcolor "255,255,255") (setvar 'cecolor "RGB:255,255,255")) (setvar 'clayer orlay) (command "_.draworder" bound "" "_F") (command "_.-bhatch" "_S" bound "" "") (setvar 'clayer "HATCH-WIPEOUT") (if (>= (atof (substr (getvar "acadver") 1 4)) 18.0) (setvar 'hpcolor "ByLayer") (setvar 'cecolor "ByLayer")) (command "_.-bhatch" "_S" bound "" "") (command "_.draworder" bound "" "_F") ) (setvar 'clayer orlay) (princ) ) Regards, M.R. Edited March 31, 2014 by marko_ribar code changed Quote Link to comment Share on other sites More sharing options...
Gouhar Nayab Posted February 17, 2018 Share Posted February 17, 2018 Thank you Gouhar Quote Link to comment Share on other sites More sharing options...
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.