Jump to content

quick HELP??? solid hatch to gradient hatch


ktbjx

Recommended Posts

This should get you started. Note - no error checking:

 

 

(defun c:GRH ( / doc i obj ss clr)
   (vl-load-com)
   (setq doc (vla-get-activedocument (setq acd (vlax-get-acad-object)))
         i 0
   )
   (if (setq ss (ssget '((0 . "HATCH"))))
      (repeat (sslength ss)
         (setq obj (vlax-ename->vla-object (ssname ss i))
               clr (vla-get-truecolor obj)
         )
         (vla-put-hatchobjecttype obj acGradientObject)
         (vla-put-gradientname obj "Spherical")
         (vla-put-gradientcolor1 obj clr)
         (vla-SetRGB clr 255 255 255)
         (vla-put-gradientcolor2 obj clr)
         (setq i (1+ i))
      )
   )
   (princ)
)

Edited by pkenewell
Corrected local variables
Link to comment
Share on other sites

This should get you started. Note - no error checking:

 

 

(defun c:GRH ( / doc i obj ss clr)
   (vl-load-com)
   (setq doc (vla-get-activedocument (setq acd (vlax-get-acad-object)))
         i 0
   )
   (if (setq ss (ssget '((0 . "HATCH"))))
      (repeat (sslength ss)
         (setq obj (vlax-ename->vla-object (ssname ss i))
               clr (vla-get-truecolor obj)
         )
         (vla-put-hatchobjecttype obj acGradientObject)
         (vla-put-gradientname obj "Spherical")
         (vla-put-gradientcolor1 obj clr)
         (vla-SetRGB clr 255 255 255)
         (vla-put-gradientcolor2 obj clr)
         (setq i (1+ i))
      )
   )
   (princ)
)

 

thank you so much sir! this is exactly what we needed!!!

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...