ktbjx Posted July 7, 2016 Share Posted July 7, 2016 anyone knows some lisp to make solid hatch into gradient sphere hatch??? i attached a dwg file for the one i need solid to gradient.dwg Quote Link to comment Share on other sites More sharing options...
ktbjx Posted July 8, 2016 Author Share Posted July 8, 2016 ouch no one bothered Quote Link to comment Share on other sites More sharing options...
pkenewell Posted July 8, 2016 Share Posted July 8, 2016 (edited) 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 July 8, 2016 by pkenewell Corrected local variables Quote Link to comment Share on other sites More sharing options...
ktbjx Posted July 8, 2016 Author Share Posted July 8, 2016 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!!! 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.