Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

My question .... a second time .... please!

20 views
Skip to first unread message

rsajr

unread,
Dec 20, 2002, 5:00:03 PM12/20/02
to
On 12/17/02 I asked:

How do I get a list of the current THAWED (only) layers within a (current)
viewport ... and then write these layer names to an external file?

Would someone be so kind as to offer a little help here?


Paul Turvill

unread,
Dec 20, 2002, 5:19:30 PM12/20/02
to
There's no list if "thawed" layers for a viewport. Only *Frozen* layers. To
determine which layers are visible (i.e., *not* frozen) you need to compare
the list of frozen layers found in the viewport's DXF data to a list of
*all* layers in the drawing.

You can find a list of the frozen layers in a viewport by examining the
multiple groups 1003 for the extended list obtained with
(enget(car(entsel))'("ACAD"))
for the viewport of interest.

Then you can step through the Layer Table with (tblnext ...) and keep track
of which layers in the Layer Table are *not* among those frozen in the
viewport.

There may be a (vl-xxx)/(vla-xxx)/(vlx-xxx) function to do this more
quickly, but I'm not familiar with one.

BTW, your demanding attitude won't win you many friends here. These NGs
offer peer-to-peer assistance and discussion; no one who hangs out here is
under any kind of obligation to help anyone, especially someone who starts
showing an "attitude."
___

"rsajr" <in...@cadesigner.com> wrote in message
news:AE93941B6A09E349...@in.WebX.maYIadrTaRb...

Steve Adams

unread,
Dec 20, 2002, 5:56:02 PM12/20/02
to
This will write all of the frozen layer names in the selected viewport
to a file called "fl".

(setq offlist nil)
(command "pspace")
(setq a(entsel))
(setq ft a)
(setq b(entget(car a)))
(setq en(car a))
(setq yo(entget en '("acad")))
(setq yo1(assoc -3 yo))
(setq yo2(cdr(last yo1)))
(setq f(open "fl" "w"))
(setq yo3(cdr(assoc 1003 yo2)))
(setq b2(last yo))
(setq c(cdr(cdr(last b2))))
(setq len(length c))
(setq ct 0)
(repeat len
(progn
(if (= (car(nth ct c)) 1003)
(progn
(setq bb(cdr(nth ct c)))
(write-line bb f)
)
) (setq ct(1+ ct))
);progn
);repeat
(close f)


rsajr

unread,
Dec 20, 2002, 6:07:41 PM12/20/02
to
Sorry to you too Rudy, and I did say please .....

"Rudy" <Ru...@cadentity.com> wrote in message
news:3A6131816733D07F...@in.WebX.maYIadrTaRb...
> Are you reading through the sentence?
>
> It doesn't sound demanding at all.


>
> > > Would someone be so kind as to offer a little help here?
>

> Sounds more like a plea for help.
>
> WOULD SOME OFFER A HELP, NOW!
>
> That sounds more demanding.
>
> Are you OK today Paul?
>
> Please! sounds good too.
>
>
> "Paul Turvill" <nos...@turvill.com> wrote in message
> news:F8272A83CEBC2232...@in.WebX.maYIadrTaRb...

Rudy

unread,
Dec 20, 2002, 5:46:14 PM12/20/02
to
Are you reading through the sentence?

It doesn't sound demanding at all.

> > Would someone be so kind as to offer a little help here?

Sounds more like a plea for help.

WOULD SOME OFFER A HELP, NOW!

That sounds more demanding.

Are you OK today Paul?

Please! sounds good too.


"Paul Turvill" <nos...@turvill.com> wrote in message
news:F8272A83CEBC2232...@in.WebX.maYIadrTaRb...

Paul Turvill

unread,
Dec 20, 2002, 6:16:47 PM12/20/02
to
Apologies, if I seemed a bit impatient (see my reply to Rudy).

Just to show that I'm at least *trying* to keep the meaning of the Season,
try the following:

;;VPLLIST.LSP - ViewPort Layer Listing Routine
;; Creates a file VLayer.txt containg the names of all layers
;; not frozen in the current floating paper space layout
;;
;;CAUTION - This is a "skeleton" routine, intended only to
;; demonstrate principles of data extraction. It contains no
;; error trapping or other "bulletproofing," and does not check
;; to confirm that a floating paper space viewport is current.
;; It should be used with these limitations firmly in mind.

;;(c) 2002 Tee Square Graphics


;;Function to get list of layers frozen in current viewport:

(defun fvplist (/ vp vpdat exdat llist)
(setq vp (ssget "x" (list '(0 . "viewport")(cons 69 (getvar "cvport"))))
vpdat (entget (ssname vp 0) '("ACAD"))
exdat (cdadr (assoc -3 vpdat))
);;setq
(foreach x (cdr exdat)
(if (= (car x) 1003)
(setq llist (append (list (cdr x)) llist))
);;if
);;foreach
llist
);;defun


;;Main program - writes list of visible layers to file:

(defun C:VPLLIST (/ frz lyr)
(setq frz (fvplist)
outf (open "VLayer.txt" "w")
);;setq
(while (setq lyr (tblnext "layer" (not lyr)))
(setq lname (cdr (assoc 2 lyr)))
(if (not (member lname frz))
(write-line lname outf)
);;if
);;while
(close outf)
(alert "List of visible layers written to VLayer.txt")
(princ)
);;defun

"rsajr" <in...@cadesigner.com> wrote in message

news:CB9373D1C0231860...@in.WebX.maYIadrTaRb...

Paul Turvill

unread,
Dec 20, 2002, 6:21:23 PM12/20/02
to
...forgot to localize a few variables; change the appropriate line to read

(defun C:VPLLIST (/ frz outf lyr lname)
___

"Paul Turvill" <nos...@turvill.com> wrote in message

news:FEE3C79C6C913526...@in.WebX.maYIadrTaRb...

rsajr

unread,
Dec 20, 2002, 6:13:48 PM12/20/02
to
Thanks Paul for the "pointers" and I am sorry if my "attitude" put some off
but I originally asked for a little help as I said on the seventeenth and no
one offered anything. I looked at a query just above mine and there were
eight responses within a 24 hour period. The ONLY reason I structured my
second request as I did was to get some attention to my original. And yes I
DO understand that no one is under any obligation to help anyone.

Will everyone PLEASE accept my apology?

"Paul Turvill" <nos...@turvill.com> wrote in message

news:F8272A83CEBC2232...@in.WebX.maYIadrTaRb...

Paul Turvill

unread,
Dec 20, 2002, 6:13:31 PM12/20/02
to
I think I did offer quite a bit of help, Rudy. Sorry if my last paragraph
sounded a bit harsh; maybe I read too much into the the "intonation" of

Would someone be so kind as to offer a little help here?

...as it sounded a bit like an impatient customer in a KMart checkout line
(to which some of us have had too much exposure recently).
___

"Rudy" <Ru...@cadentity.com> wrote in message
news:3A6131816733D07F...@in.WebX.maYIadrTaRb...

Paul Turvill

unread,
Dec 20, 2002, 6:31:06 PM12/20/02
to
You'll often see some queries going unanswered for days. A few never get
answered. Sometimes it's because the question isn't clear, and sometimes
it's just that it asks a question in an area in which none of the usual
"lurkers" here feel competent to comment. With me, it also depends on how
rushed I'm feeling when I run across a question that interests me. If I have
a quick two-word answer, I'll usually answer immediately; if the question
demands some research, or finding a file I haven't used in several months,
or something that's just a bit more difficult to explain, I may put the
query in my Saved Items folder to follow up later, if no one else responds
in the meantime.

Sorry to say that I don't recall seeing your original post of the 17th, or I
probably would have given it a quick reply.

Anyway, I hope you'll find the code I posted of some help.
___

"rsajr" <in...@cadesigner.com> wrote in message

news:8C005B8640DD43E0...@in.WebX.maYIadrTaRb...

rsajr

unread,
Dec 20, 2002, 6:22:13 PM12/20/02
to
Thanks Paul, and a Merry Christmas to you too ... and a Happy and Prosperous
New Year

"Paul Turvill" <nos...@turvill.com> wrote in message

news:FEE3C79C6C913526...@in.WebX.maYIadrTaRb...

Bill DeShawn

unread,
Dec 22, 2002, 11:54:35 PM12/22/02
to
Paul. You've been doing this for a long time. You know already to take
that kind of comment with a grain of salt, especially since the title of his
message already expresses that this question has been asked already and
apparently ignored. He's just trying to get your attention using a
different method than before, and it wasn't really a rude method, just a
little more assertive. You're a good man, Paul, and everybody out here
appreciates your help out here. I speak for myself mostly when I say that.
You have my permission to take the rest of the day off.
Oh, it's almost 9:00 at night? :)
--
__________

Bill DeShawn
bdes...@prodigy.net
http://pages.prodigy.net/bdeshawn/bdeshawn.htm


"Paul Turvill" <nos...@turvill.com> wrote in message

news:1CA757BF033FDEB1...@in.WebX.maYIadrTaRb...

0 new messages