Barry_47 Posted August 19, 2014 Share Posted August 19, 2014 Is Some one here to help me or can write program for me. as in my daily work of drafting i have to solid hatch closed areas of drawing. and they are plenty in figures. with are in diffrent colour of boundries. is any one can help me to fill that closed boundry with its boundry colour. it will help me to boost my productiviry. if any lisp routine to recognize its boundry colour to fill in solid. it will be very much helpful to my daily work. thank you. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted August 19, 2014 Share Posted August 19, 2014 I moved your post to a new thread in AutoLISP, Visual LISP & DCL Forum. Quote Link to comment Share on other sites More sharing options...
7o7 Posted August 20, 2014 Share Posted August 20, 2014 Can you explain more clearly with a dwg file? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 20, 2014 Share Posted August 20, 2014 Two examples . Easy to add layer etc as well. (defun C:hatchcol1 ( / obj hatcol) (vl-load-com) (setq obj (car (entsel))) (setq hatcol (vlax-get-property (vlax-Ename->Vla-Object obj) 'color)) (setvar "HPNAME" "Solid") ;set hatch pattern (command "-Hatch" "S" obj "" "CO" hatcol "" "") ) ;inside objects (defun C:hatchcol2 ( / obj hatcol pt) (vl-load-com) (princ "\nPlease pick object for color") (setq obj (car (entsel))) (setq hatcol (vlax-get-property (vlax-Ename->Vla-Object obj) 'color)) (setq pt (getpoint "\nPlease pick inside objects")) (setvar "HPNAME" "Solid") ;set hatch pattern (command "-Hatch" pt "" "CO" hatcol "" "") ) Quote Link to comment Share on other sites More sharing options...
Barry_47 Posted August 20, 2014 Author Share Posted August 20, 2014 thank you BIGAL it works nicely but it wont recognise its boundry colour. because all closed boundry colours are diffrent. if it recognise it then it boost my productivity 200%. thanks you once again. i dont know how to load sample drawing. Quote Link to comment Share on other sites More sharing options...
Barry_47 Posted August 20, 2014 Author Share Posted August 20, 2014 BIGAL it does one by one i want globally hatch at a time with its boundry colour thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 20, 2014 Share Posted August 20, 2014 (edited) Try this Barry and let me know Note: if you do not want to select objects by a user , just change the mode string "_:L" to "_X" in the following codes . (defun c:Test (/ *error* v l ss doc) ;; Tharwat 20. Aug. 2014 ;; ;; Hatching closed objects with Solid pattern ;; ;; with respect to the color of the objects ;; (defun *error* (x) (if v (mapcar 'setvar '(HPNAME CMDECHO) v) ) (if (wcmatch (strcase x) "*BREAK*,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " x " **")) ) ) (setq l (entlast) v (mapcar 'getvar '(HPNAME CMDECHO)) ) (if (setq ss (ssget "_:L" '((0 . "SPLINE")))) (progn (mapcar 'setvar '(HPNAME CMDECHO) '("SOLID" 0)) (setq l (entlast)) (vla-startUndomark (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))) ((lambda (i / sn c o) (while (setq sn (ssname ss (setq i (1+ i)))) (command "_.-hatch" "S" sn "" "") (if (not (eq l (setq o (entlast)))) (if (setq c (assoc 62 (entget sn))) (entmod (append (entget o) (list (cons 62 (cdr c))))) (entmod (append (entget o) '((62 . 256)))) ) ) (setq l o) ) ) -1 ) (vla-Endundomark doc) ) ) (*error* nil) )(vl-load-com) Edited August 21, 2014 by Tharwat Quote Link to comment Share on other sites More sharing options...
Barry_47 Posted August 21, 2014 Author Share Posted August 21, 2014 Dear tharwat i tried with this code it works, but fill with current layer color. I want it to recognise its boundry colour. As boundry colours are different. It should fill with its boundry color. I appriciate your help. Barry Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 21, 2014 Share Posted August 21, 2014 Dear tharwati tried with this code it works, but fill with current layer color. I want it to recognise its boundry colour. As boundry colours are different. It should fill with its boundry color. I appriciate your help. Barry I am sorry , I did not try the codes before posting it , I modified it and you can try again . Quote Link to comment Share on other sites More sharing options...
Barry_47 Posted August 21, 2014 Author Share Posted August 21, 2014 Dear Tharwat, thank you very much. its works with plain circle, rectangle. but not with shaped outlines. pls explain me how to send a perticular dwg to you so that you can persanally check whtas the problem with it. how can i post my sample dwg to you. let me know. its works with any colour bou now with my closed shapes. thanking you Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 21, 2014 Share Posted August 21, 2014 It works with circles , ellipses and closed polylines ONLY . To upload a sample drawing , go Reply to Thread then at the bottom of the right side hand there is a button entitled Go Advanced then you should be able to attach . Quote Link to comment Share on other sites More sharing options...
Barry_47 Posted August 21, 2014 Author Share Posted August 21, 2014 Dear Tharwat, thank you very much. its works with plain circle, rectangle. but not with shaped outlines. pls explain me how to send a perticular dwg to you so that you can persanally check whtas the problem with it. how can i post my sample dwg to you. let me know. its works with any colour bou now with my closed shapes. thanking you Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 21, 2014 Share Posted August 21, 2014 You saved the file with password ? Quote Link to comment Share on other sites More sharing options...
Barry_47 Posted August 21, 2014 Author Share Posted August 21, 2014 i am sorry it wont open pls give password rochell Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 21, 2014 Share Posted August 21, 2014 I modified it to work with Splines only , try from HERE and let me know . Quote Link to comment Share on other sites More sharing options...
Barry_47 Posted August 21, 2014 Author Share Posted August 21, 2014 Dear Tharwat, It work very efficiently. Many thanks once again. It is saving my lots and lots of time. And it will boost my productivity much and much higher. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 21, 2014 Share Posted August 21, 2014 Dear Tharwat,It work very efficiently. Many thanks once again. It is saving my lots and lots of time. And it will boost my productivity much and much higher. You are welcome . Wish you all the best with your work . Quote Link to comment Share on other sites More sharing options...
Barry_47 Posted August 21, 2014 Author Share Posted August 21, 2014 Today while working on Acad2014 I was trying to save at lower version of auto cad. But it was giving me message that You can only save in higher version. Even I tried to make 2004 dxf file from it. It is making dxf file of 2004 version. But when I tried to open it on acad 2006 or ever on acad 2012 auto cad it gives fatal error. While opening it. I can see preview in acad 2006 version. But problem is same. It gives message that it's size is too big. I tried to recover it but it won't allow me to save at lower version. I tried to insert same dwg in separate dwg. But not allowing me to to it. It is much much nessery to save at lower version. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 21, 2014 Share Posted August 21, 2014 Today while working on Acad2014 I was trying to save at lower version of auto cad. But it was giving me message thatYou can only save in higher version. Even I tried to make 2004 dxf file from it. It is making dxf file of 2004 version. But when I tried to open it on acad 2006 or ever on acad 2012 auto cad it gives fatal error. While opening it. I can see preview in acad 2006 version. But problem is same. It gives message that it's size is too big. I tried to recover it but it won't allow me to save at lower version. I tried to insert same dwg in separate dwg. But not allowing me to to it. It is much much nessery to save at lower version. What all of that related to this thread Barry ? Quote Link to comment Share on other sites More sharing options...
ReMark Posted August 21, 2014 Share Posted August 21, 2014 Open your drawing and purge it using the command line version pf the PURGE command which goes like this: -purge YES! Include the dash in front of the word. First purge Regapps. Repeat the command and do a Purge > All. Run the OVERKILL command on your drawing to rid it of duplicate and overlapping lines. Then run the AUDIT command and say "yes" to AutoCAD fixing any (database) errors it may find. Repeat the entire process a second time. Now save your drawing. Close it. Reopen it. Now try to do a "saveas" 2004 DXF file format. What happens? 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.