Search the Community
Showing results for tags 'hatch background color'.
-
I've wrote a function to select hatches based on their layer layColor patName patScale What I'm missing is getting the DXF data on ssget for the vla-get-backgroundcolor As I'm not sure if this is exposed to the DXF. Any help would be appreciated. Thanks. ; ; Select hatches on same layer & pattern by 3dwannab ; ; v0.1 - 16.03.2017 ; Usage: Select hatch to select other hatches on similar bkgCol color layer patName patScale (defun c:TEST nil (c:QS_HATCH_SAME_Layer_PatternName_PatternScale_Color_&_BkgColor)) (defun c:QS_HATCH_SAME_Layer_PatternName_PatternScale_Color_&_BkgColor ( / ss ssdata layer layColor patName patScale bkgCol) (while (not (and (setq ss (car (entsel "\nSelect Hatch to get same Hatch entities as:\nlayer layColor patName patScale bkgCol: ")) ssdata (if ss (entget ss)) ) (= (cdr (assoc 0 ssdata)) "HATCH") (sssetfirst nil) (setq ss (vlax-ename->vla-object ss)) (progn (setq bkgCol (vla-get-backgroundcolor ss) layColor (vla-get-color ss) layer (vla-get-Layer ss) patName (vla-get-PatternName ss) patScale (vla-get-PatternScale ss) ) (setq ss (ssget "X" (list (cons 8 layer) '(0 . "HATCH") (cons 2 patName) (cons 62 layColor) (cons 41 patScale) (cons 410 (getvar 'ctab))))) (princ (strcat "\n >>> " (itoa (setq len (sslength ss))) (if (> len 1) " items" " item") " selected <<< ")) (sssetfirst nil ss)(princ) ) ) ) (prompt "\n >>> Nothing selected, or please select a hatch ! <<< ") ) (princ) ) (vl-load-com) (princ "\n:: QS_HATCH_SAME_Layer_PatternName_PatternScale_Color_&_BkgColor.lsp | Version 1.0 | by 3dwannab ::") (princ "\n:: Type \"QS_HATCH_SAME_Layer_PatternName_PatternScale_Color_&_BkgColor\" OR \"TEST\" to Invoke ::") (princ)