Color 2 Layer
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Color 2 Layer
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
GaryDF
Guest





Posted: Fri Dec 24, 2004 8:19 pm    Post subject: Re: Color 2 Layer Reply with quote

Thanks again

Gary


"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:41cb30f7_3@newsprd01...
Quote:
Yes Gary, that is the thread I was referring to. I have not done anything
with that routine since then, and it doesn't do exactly what you originally
asked for. I was merely pointing you to it as it is a lot closer to what you
want than the one you first posted, and with some relatively minor
adjustments could be made to do what you desire.

--
Jeff
check out www.cadvault.com
"GaryDF" <fowler@architettura-inc.com> wrote in message
news:41cb2278_1@newsprd01...
Could not get my Outlook to work....so just went up to AutoDesk's web
site.
Are these the ones you were referring to? If so do you know if they have
been
updated?

Thanks

Gary

;;; Routine to set all model space Xref layers to color 9
;;; by Jeff Mishler, 5/3/03
(defun C:XREFTO9 (/ ssblk cnt blknames lay ename)
(setq ssblk (ssget "x" '((0 . "INSERT") (410 . "Model"))))
(setq cnt 0)
(setq blknames "")
(repeat (sslength ssblk) ; create list of block names in Model space for
filter
list
(setq blknames (strcat blknames (cdr (assoc 2 (entget (ssname ssblk
cnt))))
"|*,"))
(setq cnt (1+ cnt)))
(setq lay (tblnext "layer" t)) ;get layer entity
(command "undo" "be")
(while (/= lay nil)
(if (wcmatch (cdr (assoc 2 lay)) blknames) ;find xref layers, could use
assoc
70
instead
(progn (setq ename (tblobjname "layer" (cdr (assoc 2 lay))))
(setq lay (entget ename))
(if (> (cdr (assoc 62 lay)) 0) ; is the layer on?
(setq lay (subst (cons 62 9) (assoc 62 lay) lay)) ; yes it
is
(setq lay (subst (cons 62 -9) (assoc 62 lay) lay)) ; no,
it's off
)
(entmod lay)))
(setq lay (tblnext "layer")) ; next layer
)
(if ename
(prompt
"All xref layers in Model space (except \"0\" and \"defpoints\")
now color 9!")
(prompt "No xref layers found in Model Space!"))
(command "undo" "end")
(princ))







;;;R. Robert Bell, MCSE
(defun C:XRL ()
(vlax-For
Layer (vla-Get-Layers (vla-Get-ActiveDocument
(vlax-Get-Acad-Object)))
(if (wcmatch (vla-Get-Name Layer) "*|*")
(vla-Put-Color Layer 9)))
(princ))
;;;
(defun C:XRL (/ objDoc XRefs Layers)
(setq objDoc (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))
(vlax-For
Object (vla-Get-ModelSpace objDoc)
(if (vlax-Property-Available-P Object 'Path) ; simple test, should look
at
ObjectName
too!
(setq XRefs (cons (vla-Get-Name Object) XRefs))))
(setq Layers (apply 'strcat
(cons (strcat (car XRefs) "|*")
(mapcar '(lambda (str) (strcat "," str "|*"))
(cdr
XRefs)))))
(vlax-For
Layer (vla-Get-Layers objDoc)
(if (wcmatch (vla-Get-Name Layer) Layers)
(vla-Put-Color Layer 9)))
(princ))


"GaryDF" <fowler@architettura-inc.com> wrote in message
news:41cb0b59_2@newsprd01...
Thanks

Gary

"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:41cb053c_1@newsprd01...
Hi Gary,
It appears that you are using Outlook Express to access the groups
through
the nntp server. In OE, adjust the option under "Options/Read-News" to
get
all of the groups headers (it defaults to get 300 at a time). On a slow
connection this will take a while, but to be able to search back
through old
posts makes it worthwhile. And make sure to turn off any deletion of
messages that can be set in the Maintenance Tab of Options.

Doing this allows me to search through approx. 80,000 message headers,
and
if I find what I'm looking for I can read it by selecting the header.

For this search, it may help to know that the thread was started by
David
Penney.
--
Jeff
check out www.cadvault.com
"GaryDF" <fowler@architettura-inc.com> wrote in message
news:41caf9d4$1_1@newsprd01...
Forgive my ignorance, but how do I get this past thread?
I have already tried the Find Message, with no luck.

Gary


"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:41c9d248_2@newsprd01...
Gary,
if you want to change the color of layers within an Xref, this isn't
the
lisp you want. Instead, see the thread "Making all x-refs show as
colour
9
for checking...?" started on 5/2/2003......that should get you
going.

--
Jeff
check out www.cadvault.com
"GaryDF" <fowler@architettura-inc.com> wrote in message
news:41c9994c_1@newsprd01...
Jeff has a great routine below for changing the color in a
specified
layer.
I am wondering how to modify it it change xref layers with a wild
card
ex: (Color2Layer 8 "*|A-PATT-POCH") does not work

Gary

;;;by Jeff Mishler
;;; (Color2Layer 8 "A-PATT-POCH")

(defun Color2Layer (color layer / atts doc lay lays lokt)
(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for
lay (vla-get-layers doc)
(if (and (= color (vla-get-color lay))
(not (vl-string-search "|" (vla-get-name lay))))
(progn (setq lays (cons (vla-get-name lay) lays))
(if (vla-get-lock lay)
(progn (setq lokt (cons (vla-get-name lay) lokt))
(vla-put-lock lay :vlax-false))))))
(vla-startundomark doc)
(setq lay (vla-add (vla-get-layers doc) layer))
(vla-put-color lay color)
(vlax-for
blk (vla-get-blocks doc)
(vlax-for
ent blk
(if (or (eq (vla-get-color ent) color) (member (vla-get-layer
ent)
lays))
(vla-put-layer ent layer))
(if (and (vlax-property-available-p ent "hasattributes")
(vla-get-hasattributes ent)
(setq atts (vlax-invoke ent "getattributes")))
(progn
(foreach
att atts
(if (or (eq (vla-get-color att) color) (member
(vla-get-layer
att)
lays))
(vla-put-layer att layer))
(vla-update att))))))
(if lokt
(foreach
lay lokt
(vla-put-lock (vla-item (vla-get-layers doc) lay)
:vlax-true)))
(vla-endundomark doc)
(princ))















Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB