Haggbakk Posted April 16, 2009 Posted April 16, 2009 Hi, I work with both Tekla Structures and AutoCAD2008. When exporting drawings from TS to AutoCAD the Solid hatch is generated as Object type 'Solid'. I have used Qselect to find all solid objects in the drawings and changed their color to 253. It works, but it takes time. I'm looking for a lisp that can do this for me. I've searched on this and other forums, but haven't found any lisp that finds 'Solid' object types. My Lisp knowledge is unfortunately non-existent but I would like to learn more. Does someone have good lisp web pages to recommend? Thank's in advance! Quote
MiGo Posted April 16, 2009 Posted April 16, 2009 I don't know the whole lisp (working on trying) but as a quick selection of all solids this line works great. (setq ss (ssget "all" '((0 . "solid")))) Quote
lpseifert Posted April 16, 2009 Posted April 16, 2009 Hi,. Does someone have good lisp web pages to recommend? http://www.afralisp.net/ here's a quicky (defun c:solid253 (/ ss) (setq ss (ssget "x" '((0 . "solid")))) (command "change" ss "" "p" "c" "253" "") ) Quote
MiGo Posted April 16, 2009 Posted April 16, 2009 Now i'm kinda new at this too, but this worked for me (defun c:solchg () (setq ss (ssget "all" '((0 . "solid")))) (if (/= (sslength ss) nil) (command "Chprop" ss "" "c" "253" "") (princ "\nNo SOLIDS FOUND!") ) (princ) ) SolidColorCHG.lsp Quote
MiGo Posted April 16, 2009 Posted April 16, 2009 Well it seems to select all solids in paper space and in model space. If you have no solids in the space your in then it won't work. hmm... Quote
Haggbakk Posted April 21, 2009 Author Posted April 21, 2009 Sorry for late response, I've had a lots of work to do despite the financial crisis.. :wink: It works perfect for me! Thank you so much and thanks for the link. Now I will have a lot of spare time enjoying the sunny weather outside. Quote
Lee Mac Posted April 21, 2009 Posted April 21, 2009 I suppose MiGo's code could be re-written more succinctly as: (defun c:solchg (/ ss) (if (setq ss (ssget "X" '((0 . "SOLID")))) (command "Chprop" ss "" "c" "253" "") (princ "\n<!> No SOLIDS FOUND! <!>")) (princ)) Or in VLA: (defun c:solchg (/ ss sel) (vl-load-com) (if (setq ss (ssget "X" '((0 . "SOLID")))) (progn (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)))) (vla-put-color Obj 253)) (vla-delete sel)) (princ "\n<!> No Solids Found <!>")) (princ)) Getting carried away now... 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.