Search the Community
Showing results for tags 'hatch rotation'.
-
HATCH Angle is not getting selected until I run the -hatchedit command
3dwannab posted a topic in AutoLISP, Visual LISP & DCL
Hi all, Here's a LISP that I'm having a problem with. Everything's working OK apart from getting the angle of the HATCH working. It doesn't work until I run it through a -hatchedit command. Is this a UCS problem? Drawing: Hatch Rotation Selection Issue.dwg LISP: (defun c:QSHLPASCB nil (c:QSHATCH_SAME_Layer_PatName_Rotation_PatScale_Color&BkgColor)) (defun c:QSHATCH_SAME_Layer_PatName_Rotation_PatScale_Color&BkgColor (/ bkgcol ent_1 laycolor layer nss patangle patname patscale ss_1 ssdata ) (while (not (and (setq ent_1 (car (entsel "\nSelect Hatch to get same Hatch entities as:\n\n- LAYER\n- PATTERN NAME\n- PATTERN ANGLE\n- PATTERN SCALE\n- COLOUR\n- BACKGROUND COLOUR\n-------------------------------------------------------------")) ssdata (if ent_1 (entget ent_1)) ) (= (cdr (assoc 0 ssdata)) "HATCH") (sssetfirst nil) (setq ss_1 (vlax-ename->vla-object ent_1)) (progn (setq bkgcol (vla-get-backgroundcolor ss_1) bkgcol (vla-get-ColorIndex (vla-get-BackgroundColor ss_1)) laycolor (vla-get-color ss_1) layer (vla-get-Layer ss_1) patname (vla-get-PatternName ss_1) patangle (vla-get-PatternAngle ss_1) patscale (vla-get-PatternScale ss_1) ss_1 (ssget "X" (vl-remove 'nil (list (cons 8 layer) '(0 . "HATCH") (cons 2 patname) (cons 52 patangle) (cons 62 laycolor) (cons 410 (getvar 'ctab)) (if (/= "SOLID" patname) (cons 41 patscale) ) ) ) ) nss (ssadd) ) (repeat (setq i (sslength ss_1)) (and (setq e (ssname ss_1 (setq i (1- i)))) (= bkgcol (vla-get-ColorIndex (vla-get-BackgroundColor (vlax-ename->vla-object e)))) (ssadd e nss) ) ) (princ (strcat "\n: ------------------------------\n <<< "(itoa (sslength ss_1)) (if (> (sslength ss_1) 1) " >>> similar HATCHES" " >>> similar HATCH") " selected.\n: ------------------------------\n")) (sssetfirst nil nss) ) ) ) ) (princ) )