Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

change all object colors in xref bylayer

11 REPLIES 11
Reply
Message 1 of 12
SergeM
701 Views, 11 Replies

change all object colors in xref bylayer

Hello there,

Is there a possibilty (a lisp or macro) to change

all the object colors on the XREF drawing BYLAYER.

i want to change the color in to a gray for the plotting.

Is it possible to do this in one lisp (change bylayer and change the color into gray?)

many thanks

Serge
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: SergeM

I assume you *don't* want to change them in the source drawing. You can change layer colors and
other layer characteristics of an Xref within another drawing, and keep them that way in that
drawing with the VISRETAIN System Variable set to 1. But I don't think you can change assigned
object colors that aren't BYLAYER in the Xref, except by Refediting it and thereby changing them in
the source drawing. You may have to Bind the Xref into the target drawing. Then you would be able
to Refedit the resulting Block insertion, and change all its object colors, etc., without affecting
the source drawing. But that, of course, means that any later changes in the source drawing would
no longer be reflected in the target drawing.

The "ideal" solution is for the color of everything in the source drawing to be BYLAYER, if that
will work for you. Then you can pretty easily make a routine to change all the Xref's layer colors
within the target drawing to whatever color you want.
--
Kent Cooper


wrote...
Hello there,

Is there a possibilty (a lisp or macro) to change

all the object colors on the XREF drawing BYLAYER.

i want to change the color in to a gray for the plotting.

Is it possible to do this in one lisp (change bylayer and change the color into gray?)

many thanks

Serge
Message 3 of 12
Anonymous
in reply to: SergeM

You can get all the entities that define the xref by reading the block
record, step through each one and (entmod) to make the color bylayer... if
the xref contains and INSERT object then step through it's block record the
same way.

I do this all the time. Each time the drawing is opened, the xrefs are
scanned for various modifications to make.



wrote in message news:5684192@discussion.autodesk.com...
Hello there,

Is there a possibilty (a lisp or macro) to change

all the object colors on the XREF drawing BYLAYER.

i want to change the color in to a gray for the plotting.

Is it possible to do this in one lisp (change bylayer and change the color
into gray?)

many thanks

Serge
Message 4 of 12
t.willey
in reply to: SergeM

But watch out because I tried this before, and when you reload the xrefs,
all the objects properties go back to the way they are i the xref drawing.
If I remember correctly.

--

Tim
"A blind man lets nothing block his vision."


"mataeux" wrote in message
news:5684244@discussion.autodesk.com...
You can get all the entities that define the xref by reading the block
record, step through each one and (entmod) to make the color bylayer... if
the xref contains and INSERT object then step through it's block record the
same way.

I do this all the time. Each time the drawing is opened, the xrefs are
scanned for various modifications to make.



wrote in message news:5684192@discussion.autodesk.com...
Hello there,

Is there a possibilty (a lisp or macro) to change

all the object colors on the XREF drawing BYLAYER.

i want to change the color in to a gray for the plotting.

Is it possible to do this in one lisp (change bylayer and change the color
into gray?)

many thanks

Serge
Message 5 of 12
Anonymous
in reply to: SergeM

yes.
but the benefit is that when you receive an update, you won't need to modify
anything


wrote in message news:5684252@discussion.autodesk.com...
But watch out because I tried this before, and when you reload the xrefs,
all the objects properties go back to the way they are i the xref drawing.
If I remember correctly.

--

Tim
"A blind man lets nothing block his vision."


"mataeux" wrote in message
news:5684244@discussion.autodesk.com...
You can get all the entities that define the xref by reading the block
record, step through each one and (entmod) to make the color bylayer... if
the xref contains and INSERT object then step through it's block record the
same way.

I do this all the time. Each time the drawing is opened, the xrefs are
scanned for various modifications to make.



wrote in message news:5684192@discussion.autodesk.com...
Hello there,

Is there a possibilty (a lisp or macro) to change

all the object colors on the XREF drawing BYLAYER.

i want to change the color in to a gray for the plotting.

Is it possible to do this in one lisp (change bylayer and change the color
into gray?)

many thanks

Serge
Message 6 of 12
SergeM
in reply to: SergeM

Hello Kent,

Ok.
How does the routine look like? and is it possible to make a
customized button for that?

Thanks

Serge
Message 7 of 12
SergeM
in reply to: SergeM

Hello Mataeux and Tim,

What are the procedures to read the block record?
(explain it step by step please)

And how to handle with entmod and make the color by layer?
(explain it step by step please)

And how to handle with stepping to block records and make the color by layer?
(explain it step by step please)

Is it possible to write a lisp to do that?? Can you do that?
By the way i m still working with acad 2002.

Many thanks

Serge
Message 8 of 12
Anonymous
in reply to: SergeM

If everything in the source drawing is colored BYLAYER, than it could be as simple as:

(command "_.Layer" "_C" "whatevercolor" "xrefname|*" "")
(setvar 'visretain 1)

or in macro format:

^C^C-Layer C whatevercolor xrefname|* ;visretain 1

or in script format:

^C^C-Layer
C
whatevercolor
xrefname|*

visretain
1

You could put it on a toolbar or tool pallette button, or a pull-down menu, or a screen menu, or a
tablet menu, or a script, or define it as a command with (defun) and type the command name, or put
that command name in a location in any of the menu types. Exactly how you put it in them varies a
little with the menu type, but if you get into the menu file, you can see how other things are put
there.

--
Kent Cooper


wrote...
Hello Kent,

Ok.
How does the routine look like? and is it possible to make a
customized button for that?

Thanks

Serge
Message 9 of 12
t.willey
in reply to: SergeM

The easy way is
Select the xref.
Use 'tblobjname' on the block table with the name of the xref.
Then you will step through all the objects within the block using 'entnext'.
To make them bylayer, either remove the dxf code for color '62' or just
change it to 256.

Sounds easy right? Well it is. Let us know if you have any problems.

If you want to change all the nested block objects within the xref. Just do
the same thing when you run into a block.

--

Tim
"A blind man lets nothing block his vision."


wrote in message news:5685326@discussion.autodesk.com...
Hello Mataeux and Tim,

What are the procedures to read the block record?
(explain it step by step please)

And how to handle with entmod and make the color by layer?
(explain it step by step please)

And how to handle with stepping to block records and make the color by
layer?
(explain it step by step please)

Is it possible to write a lisp to do that?? Can you do that?
By the way i m still working with acad 2002.

Many thanks

Serge
Message 10 of 12
SergeM
in reply to: SergeM

Thanks Tim,

I 'll give it a try and let you know tomorrow.

greetings Serge
Message 11 of 12
SergeM
in reply to: SergeM

Thanks Kent,

I 'll give it a try and let you know tomorrow.

greetings Serge
Message 12 of 12
jaydee
in reply to: SergeM

Google "Nest103.VLX"
It does amazing things to Xrefs

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost