Lee Mac Posted January 27, 2009 Posted January 27, 2009 (setq 3dsolid ss);if object is solid (princ "\nHow will I do this?") ;;; Can't you just use the "chprop" "C" colournumber "" Quote
totzky Posted January 28, 2009 Posted January 28, 2009 Thanks for your time Lee.Honestly, I'm not even using this kind of LISP. I am more inclined to use changeprop or the properties dialogue. I don't really want to insist on my issue, that is, to call some attention on what I found out.It's enough that I have satisfy my beginner's curiosity for now. Maybe in time I will be able to figure it out. Quote
Lee Mac Posted January 28, 2009 Posted January 28, 2009 Maybe in time I will be able to figure it out. Maybe I'm missing the point, but why wont the supplied LISPs work for 3DSolids? Quote
totzky Posted January 28, 2009 Posted January 28, 2009 Maybe I'm missing the point, but why wont the supplied LISPs work for 3DSolids? Apologies, Lee Mac and CarlB. I might have confused myself trying to figure out why I keep getting an error when I'm using your code changing the color to "0" or "256". I should have written "BYlayer" or "ByBlock. Quote
Lee Mac Posted January 28, 2009 Posted January 28, 2009 No probs Totzky, we all make mistakes - after all, we're only human (with the exception of Remark) Quote
totzky Posted January 28, 2009 Posted January 28, 2009 CarlB's code should look something like this: (defun c:0 () (if (setq p1 (cadr (ssgetfirst))) (progn (sssetfirst) (command "chprop" p1 "" "C" "ByBlock" "") ) ) (princ) ) Quote
totzky Posted January 28, 2009 Posted January 28, 2009 No probs Totzky, we all make mistakes - after all, we're only human (with the exception of Remark) Hahaha and ha!!! Good day to you Lee! Quote
Lee Mac Posted January 28, 2009 Posted January 28, 2009 Just as a side note, one can use colours 0, and 256 for substituting into DXF group codes to set the colour (62) to byBlock and byLayer: i.e. (defun c:0 (/ ent eList) (while (setq ent (car (entsel "\nSelect Objects > "))) (setq eList (entget ent)) (if (assoc 62 eList) (setq eList (subst (cons 62 0)(assoc 62 eList) eList)) (setq eList (append eList (list (cons 62 0))))) (entmod eList)) (princ)) And for By Layer: (defun c:256 (/ ent eList) (while (setq ent (car (entsel "\nSelect Objects > "))) (setq eList (entget ent)) (if (assoc 62 eList) (setq eList (subst (cons 62 256)(assoc 62 eList) eList)) (setq eList (append eList (list (cons 62 256))))) (entmod eList)) (princ)) Quote
Baber62 Posted November 2, 2012 Posted November 2, 2012 @ Lee Mac, Always a source of knowledge. I cam across this routine (http://cadtips.cadalyst.com/layer-properties/change-xref-layer-colors-quickly) which changes the xref colours. However, it does so by only allowing the user to select a single x-ref at a time. I would be grateful if this could be adapted to allow the user to chose multiple x-references in the same drawing. The coding is as below I have changed it so the x-reference colour changes to white (no. 7). (defun C:XR7 (/ EN L X) (setq EN (nentsel "\nSelect Xref: ") L (cdr (assoc 8 (entget (car EN)))) X (substr L 1 (vl-string-position (ascii "|") L)) ) (if (/= (vl-string-search "|" L) nil) (progn (vlax-for layer (vla-get-Layers (vla-get-ActiveDocument (vlax-get-Acad-Object))) (if (/= (vl-string-search (strcat X "|") (vla-get-name layer)) nil)(vla-put-Color layer 7)) ) (command ".REGEN") ) (alert "Not an Xref!") ) (prin1) ) Quote
Lee Mac Posted November 2, 2012 Posted November 2, 2012 The code you have posted is changing the colour of the layer of a single object within a selected XRef, not the colour of the XRef itself. Multiple selection (such as window selection) of nested objects is not possible using the standard selection methods, however, if you are instead looking to change the layer colour for all XRef layers of a selected XRef, the program could allow multiple XRef selection since there needn't be a distinction as to which subentity is to be modified. Quote
Baber62 Posted November 2, 2012 Posted November 2, 2012 Lee, So the coding above only changes the x-ref colour for that particular drawing and does not change the x-ref itself. So to change the x-ref itself both bylayer and byblock it would require the two routines that you have posted earlier? Would it be possible to combine those two routines into one and allow the user to select multiple x-refs? As I have a drawing with about 20 TQ tiles and it gets tiresome opening them individually, changing the colour for all layers to white and saving them back again. Any help would be appreciated. Quote
Lee Mac Posted November 2, 2012 Posted November 2, 2012 So the coding above only changes the x-ref colour for that particular drawing and does not change the x-ref itself. No, the program you have posted is changing the properties of the XRef-dependent layers in the drawing in which the XRef is inserted, it makes no changes to the XRef source drawing. Whether such changes are retained after the drawing is closed will be dependent on the setting of your VISRETAIN System Variable. As I have a drawing with about 20 TQ tiles and it gets tiresome opening them individually, changing the colour for all layers to white and saving them back again. Any help would be appreciated. You needn't modify the original XRef source file. Depending on the behaviour you are looking to obtain, you can alter the XRef-dependent layers in the drawing referencing the XRef, however, be aware of the VISRETAIN System Variable, as stated above. Quote
Baber62 Posted November 2, 2012 Posted November 2, 2012 Thanks Lee appreciate your time in educating me 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.