MarcoW Posted June 2, 2010 Posted June 2, 2010 In a routine I have there is a line like this: (command "_.hatch" "ANSI32" 50.0 0.0 "_l" "") These hatches stay not associative even though I have set the variable "HPASSOC" to 1. I need them to be associative. So I tried manually on the command bar, how to hatch the last created entity (if hatchable like a rectangle): (command "_.hatch" "A" "A" "Yes" "" "P" "ANSI32" 50.0 0.0 "S" "_L" "") But that doesn't seem to work... Any idea how to make the hatch associative? Thanks in advance for helping me out once again. (ps.: I have been here and that doe not help, it still disfunctions) Quote
ronjonp Posted June 2, 2010 Posted June 2, 2010 Give this a try: (defun c:hatchit (/ doc e h o) (if (and (setq e (car (entsel "\nSelect something to hatch: "))) (setq o (vlax-ename->vla-object e)) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (setq h (vlax-invoke (if (= (getvar 'cvport) 1) (vla-get-paperspace doc) (vla-get-modelspace doc) ) 'addhatch achatchobject (getvar 'hpname) :vlax-true ) ) (not (vl-catch-all-error-p (vl-catch-all-apply 'vlax-invoke (list h 'appendouterloop (list o))) ) ) ) (progn (vlax-put h 'patternangle (getvar 'hpang)) (vlax-put h 'patternscale (getvar 'hpscale)) (setq e (vlax-vla-object->ename h)) (entmod (subst (cons 8 (strcat (vla-get-layer o) "-hatch")) (assoc 8 (entget e)) (entget e) ) ) (vla-evaluate h) ) ) (princ) ) Quote
fixo Posted June 2, 2010 Posted June 2, 2010 Try this out (tested on A2010) (command "-bhatch" "_AN" "_Y" "_S" (entsel "\nSelect contour >> ") "" "_P" "ANSI32" "" "" "") ~'J'~ 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.