Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
tdcad
Posts: 85
Registered: ‎06-16-2004
Message 1 of 13 (208 Views)

CHANGE COLOR LAYER IN XREF

208 Views, 12 Replies
01-02-2007 08:25 PM
Hi all,
I don't know much about lisp but can any one please help me come up with good lisp routine that will change all different color of layers from Xref to another color I want!

Thanks so much
*Adesu
Message 2 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-02-2007 09:30 PM in reply to: tdcad
Hi tdcad,
look at attach file.

wrote in message news:5439495@discussion.autodesk.com...
Hi all,
I don't know much about lisp but can any one please help me come up with
good lisp routine that will change all different color of layers from Xref
to another color I want!

Thanks so much
*Adesu
Message 3 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-02-2007 09:36 PM in reply to: tdcad
or with this

Works lika champ! Many thanks.

"Josh C" wrote in message
news:410e5f5e$1_2@newsprd01...
> No error checking...may require regen to see changes on certain objects
>
> (defun c:xlc ( / obj layer color)
> (while (setq obj (nentsel "\nSelect entity on layer: "))
> (setq layer (entget
> (tblobjname "layer" (cdr (assoc 8 (entget (car obj)))))
> )
> color (acad_colordlg (cdr (assoc 62 layer)))
> )
> (if color
> (entmod (subst (cons 62 color) (assoc 62 layer) layer))
> )
> )
> (princ)
> )
>
>
> "jonesr" wrote in message
> news:410e3516_2@newsprd01...
> > Does anyone have a routine to allows one to select an object in an xref
> and
> > then enter a new color for that object's layer? This would automate
using
> > the Express nested object list to obtain the name of the layer, running
> the
> > layer command and manually changing the layer. Most useful if you have a
> few
> > xref layers to change but hundreds of xref layers in the dwg.
> >
> >
>
>




wrote in message news:5439495@discussion.autodesk.com...
Hi all,
I don't know much about lisp but can any one please help me come up with
good lisp routine that will change all different color of layers from Xref
to another color I want!

Thanks so much
Valued Contributor
tdcad
Posts: 85
Registered: ‎06-16-2004
Message 4 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-03-2007 06:51 AM in reply to: tdcad
How about global. Meaning all layer color will change in one color.

Thanks
*BIGGEORGE
Message 5 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-03-2007 06:57 AM in reply to: tdcad
thanks for this wonderfull little routine.
I used to work at a place that had xe.lsp and I could change color,
linetype, off, frozen, in a dialog box.

so.....how about changing the entity linetype in xref?
--
BIGGEORGE

Where are we going and
what am I doing in this handbasket?

"Adesu" wrote in message
news:5439509@discussion.autodesk.com...
or with this

Works lika champ! Many thanks.

"Josh C" wrote in message
news:410e5f5e$1_2@newsprd01...
> No error checking...may require regen to see changes on certain objects
>
> (defun c:xlc ( / obj layer color)
> (while (setq obj (nentsel "\nSelect entity on layer: "))
> (setq layer (entget
> (tblobjname "layer" (cdr (assoc 8 (entget (car obj)))))
> )
> color (acad_colordlg (cdr (assoc 62 layer)))
> )
> (if color
> (entmod (subst (cons 62 color) (assoc 62 layer) layer))
> )
> )
> (princ)
> )
>
>
> "jonesr" wrote in message
> news:410e3516_2@newsprd01...
> > Does anyone have a routine to allows one to select an object in an xref
> and
> > then enter a new color for that object's layer? This would automate
using
> > the Express nested object list to obtain the name of the layer, running
> the
> > layer command and manually changing the layer. Most useful if you have a
> few
> > xref layers to change but hundreds of xref layers in the dwg.
> >
> >
>
>




wrote in message news:5439495@discussion.autodesk.com...
Hi all,
I don't know much about lisp but can any one please help me come up with
good lisp routine that will change all different color of layers from Xref
to another color I want!

Thanks so much
*T.Willey
Message 6 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-03-2007 08:00 AM in reply to: tdcad
I have posted one before. If you search I'm sure you will find many
routines that will suit your needs.

--

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


wrote in message news:5439495@discussion.autodesk.com...
Hi all,
I don't know much about lisp but can any one please help me come up with
good lisp routine that will change all different color of layers from Xref
to another color I want!

Thanks so much
*James Maeding
Message 7 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-03-2007 02:12 PM in reply to: tdcad
check out cadthinking.com for a free tool "ChLayCoLt"
It is much better than most simple tools because it has a "deeper" and "shallower" tool to step through nesting levels
for stuff in blocks or xrefs.
It is one of my handiest tools by far because it acts as both an info tool and a layer changer tool.
see attached image for dialog screenshot.
I have for 2007 also if anyone wants.

tdcad <>
|>Hi all,
|>I don't know much about lisp but can any one please help me come up with good lisp routine that will change all different color of layers from Xref to another color I want!
|>
|>Thanks so much
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Valued Contributor
tdcad
Posts: 85
Registered: ‎06-16-2004
Message 8 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-03-2007 10:42 PM in reply to: tdcad
Pleas! may i have it.

Thanks
*Adesu
Message 9 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-04-2007 07:11 PM in reply to: tdcad
You are welcome.
for "how about changing the entity linetype in xref" I would test it.

"BIGGEORGE" wrote in message
news:5439806@discussion.autodesk.com...
thanks for this wonderfull little routine.
I used to work at a place that had xe.lsp and I could change color,
linetype, off, frozen, in a dialog box.

so.....how about changing the entity linetype in xref?
--
BIGGEORGE

Where are we going and
what am I doing in this handbasket?

"Adesu" wrote in message
news:5439509@discussion.autodesk.com...
or with this

Works lika champ! Many thanks.

"Josh C" wrote in message
news:410e5f5e$1_2@newsprd01...
> No error checking...may require regen to see changes on certain objects
>
> (defun c:xlc ( / obj layer color)
> (while (setq obj (nentsel "\nSelect entity on layer: "))
> (setq layer (entget
> (tblobjname "layer" (cdr (assoc 8 (entget (car obj)))))
> )
> color (acad_colordlg (cdr (assoc 62 layer)))
> )
> (if color
> (entmod (subst (cons 62 color) (assoc 62 layer) layer))
> )
> )
> (princ)
> )
>
>
> "jonesr" wrote in message
> news:410e3516_2@newsprd01...
> > Does anyone have a routine to allows one to select an object in an xref
> and
> > then enter a new color for that object's layer? This would automate
using
> > the Express nested object list to obtain the name of the layer, running
> the
> > layer command and manually changing the layer. Most useful if you have a
> few
> > xref layers to change but hundreds of xref layers in the dwg.
> >
> >
>
>




wrote in message news:5439495@discussion.autodesk.com...
Hi all,
I don't know much about lisp but can any one please help me come up with
good lisp routine that will change all different color of layers from Xref
to another color I want!

Thanks so much
*Adesu
Message 10 of 13 (208 Views)

Re: CHANGE COLOR LAYER IN XREF

01-04-2007 07:33 PM in reply to: tdcad
Hi
Here as you want that code
[code]
(defun c:test (/ col lay obj opt sse sse_ton ssn ton)
(while
(null (setq obj (nentsel "\nSelect entity of Xref object: ")))
(princ "\nNO XREF OBJECT ENTITIES FOUND!") ; print
message if
(princ)
) ; while
(setq ssn (car obj))
(setq sse (entget ssn))
(setq lay (cdr (assoc 8 sse)))
(setq ton (tblobjname "layer" lay))
(setq sse_ton (entget ton))
(setq ltyp (cdr (assoc 6 sse_ton)))

(setq opt (getstring "\nEnter new linetype model: "))
(if (= opt "")(setq opt "dashed"))
(if
opt
(entmod (subst (cons 6 opt)(assoc 6 sse_ton) sse_ton))
) ; if
(princ)
)
[/code]

"Adesu" wrote in message
news:5441927@discussion.autodesk.com...
You are welcome.
for "how about changing the entity linetype in xref" I would test it.

"BIGGEORGE" wrote in message
news:5439806@discussion.autodesk.com...
thanks for this wonderfull little routine.
I used to work at a place that had xe.lsp and I could change color,
linetype, off, frozen, in a dialog box.

so.....how about changing the entity linetype in xref?
--
BIGGEORGE

Where are we going and
what am I doing in this handbasket?

"Adesu" wrote in message
news:5439509@discussion.autodesk.com...
or with this

Works lika champ! Many thanks.

"Josh C" wrote in message
news:410e5f5e$1_2@newsprd01...
> No error checking...may require regen to see changes on certain objects
>
> (defun c:xlc ( / obj layer color)
> (while (setq obj (nentsel "\nSelect entity on layer: "))
> (setq layer (entget
> (tblobjname "layer" (cdr (assoc 8 (entget (car obj)))))
> )
> color (acad_colordlg (cdr (assoc 62 layer)))
> )
> (if color
> (entmod (subst (cons 62 color) (assoc 62 layer) layer))
> )
> )
> (princ)
> )
>
>
> "jonesr" wrote in message
> news:410e3516_2@newsprd01...
> > Does anyone have a routine to allows one to select an object in an xref
> and
> > then enter a new color for that object's layer? This would automate
using
> > the Express nested object list to obtain the name of the layer, running
> the
> > layer command and manually changing the layer. Most useful if you have a
> few
> > xref layers to change but hundreds of xref layers in the dwg.
> >
> >
>
>




wrote in message news:5439495@discussion.autodesk.com...
Hi all,
I don't know much about lisp but can any one please help me come up with
good lisp routine that will change all different color of layers from Xref
to another color I want!

Thanks so much
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!