Author |
Topic |
|
advcad
Starting Member
3 Posts |
Posted - July 01 2006 : 12:09:32 PM
|
I'm a beginner with scripts. Haven't figured out how to have "all Layers with Color White", "Change to Red". Any help would be appreciated.
|
|
n/a
deleted
112 Posts |
Posted - July 03 2006 : 1:17:46 PM
|
advcad
I think you are going to have to use Autolisp within your script to search the layer table for the default color. If you time to wait, I'll try to post something by tomorrow morning. If it's not there by then, it either proved too difficult for me, or I just did not have time to get to it. (I don't think it will be too difficult or time-consuming. I just can't get to it until after work today, though, for sure. |
Steve Bubendorf
|
|
|
n/a
deleted
112 Posts |
Posted - July 03 2006 : 1:41:05 PM
|
Questions: 1.) Do you have known layers with white, or do they vary? If the white layers are known, can you please provide a list? 2.) Your question does deal with layers with white default (bylayer) color versus entities which were specifically designated to be drawn with a white color on a layer whose default color may have been something other than white, correct? |
Steve Bubendorf
|
|
|
advcad
Starting Member
3 Posts |
Posted - July 03 2006 : 2:49:50 PM
|
quote: Originally posted by sbubendorf
Questions: 1.) Do you have known layers with white, or do they vary? If the white layers are known, can you please provide a list? 2.) Your question does deal with layers with white default (bylayer) color versus entities which were specifically designated to be drawn with a white color on a layer whose default color may have been something other than white, correct?
1. Layers Vary 2. These are Layers with white default. Thanks for responding |
|
|
n/a
deleted
112 Posts |
Posted - July 03 2006 : 4:12:09 PM
|
(load "CLCWHITE2RED") CLCWHITE2RED
The two lines above (exactly as shown, with parentheses & quotes) should be all you need in your script file in Hurricane.
Back up your drawing files to a second safe location before proceeding.
Unzip the attached file to the folder where your original drawings are, or to a folder in your AutoCAD path. Run the Hurricane script on your drawings. Hopefully you will get the results you are looking for. It seemed to work here, if I understood your situation correctly. It's a pretty basic lisp without any error checking and it was tested on basic, small files without Xrefs, so it's possible you could get different results than I did.
Please let me know whether or not it works for you. If it doesn't, I may be able to make some small modification that will make it run. (NO PROMISES !! )
Download Attachment: CLCWHITE2RED.zip 779 Bytes |
Steve Bubendorf
|
|
|
advcad
Starting Member
3 Posts |
Posted - July 04 2006 : 08:47:21 AM
|
quote: Originally posted by sbubendorf
(load "CLCWHITE2RED") CLCWHITE2RED
The two lines above (exactly as shown, with parentheses & quotes) should be all you need in your script file in Hurricane.
Back up your drawing files to a second safe location before proceeding.
Unzip the attached file to the folder where your original drawings are, or to a folder in your AutoCAD path. Run the Hurricane script on your drawings. Hopefully you will get the results you are looking for. It seemed to work here, if I understood your situation correctly. It's a pretty basic lisp without any error checking and it was tested on basic, small files without Xrefs, so it's possible you could get different results than I did.
Please let me know whether or not it works for you. If it doesn't, I may be able to make some small modification that will make it run. (NO PROMISES !! )
Download Attachment: CLCWHITE2RED.zip 779 Bytes
Thank you for your response. The files I had to modify had xrefs. Perhaps that is why your script didn't quite work. Here is a script that "Jeff Mishler" from the AutoCad discussion group sent me that worked with the xrefs. ;BEGIN SCRIPT (defun color->othercolor (old new / layer layent) (while (setq layer (tblnext "LAYER" (not layer))) (if (= (cdr (assoc 62 layer)) old) (progn (setq layent (entget (tblobjname "LAYER" (cdr (assoc 2 layer))))) (entmod (subst (cons 62 new) (assoc 62 layent) layent)) ) ) ) ) (color->othercolor 7 1)
Again, thanks for reponding. |
|
|
|
Topic |
|