Discussion:
Layer merge automatically.
(too old to reply)
Casey Roberts
2004-10-05 20:51:45 UTC
Permalink
Does anyone have a lisp or is anyone able to point me in the right direction
for creating a lisp that will do accomplish the following.

Currently, I have a drawing with multiple layers that have been prefixed
with a drawing name (These were xref's that have been bound to the drawing I
am working with.)

There are several 'similar' layers which I would like to merge into the same
layer. The difference between the layernames is the prefix portion. Is
there a way to automate this process as typing in all the layer names is a
time consuming process.

For example, I have a drawing with layers named:

UNIT-A-1$0$A-BALCONY
UNIT-A-1$0$A-COLUMN
UNIT-A-1$0$A-RAIL
UNIT-B-1$0$A-BALCONY
UNIT-B-1$0$A-COLUMN
UNIT-B-1$0$A-RAIL
UNIT-C-1$0$A-BALCONY
UNIT-C-1$0$A-COLUMN
UNIT-C-1$0$A-RAIL
UNIT-D-1$0$A-BALCONY
UNIT-D-1$0$A-COLUMN
UNIT-D-1$0$A-RAIL

I would like them combined into layers
A-BALCONY
A-COLUMN
A-RAIL

(this is only a small portion of the actual layer list)

TIA


Casey
unknown
2004-10-06 05:21:43 UTC
Permalink
Hi Casey. Have you already looked into the built-in laytrans command?
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO
Casey Roberts
2004-10-06 13:47:54 UTC
Permalink
And apparently it's too early for me to spell correctly...varyious? :-(
Thanks for the suggestion, it works but it's still a tedios process when
dealing with hundreds of layers in multiple drawings with varyious 'maps'
required that are not the same fore each drawing.
Post by unknown
Hi Casey. Have you already looked into the built-in laytrans command?
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO
Casey Roberts
2004-10-06 13:44:17 UTC
Permalink
Thanks for the suggestion, it works but it's still a tedios process when
dealing with hundreds of layers in multiple drawings with varyious 'maps'
required that are not the same fore each drawing.
Post by unknown
Hi Casey. Have you already looked into the built-in laytrans command?
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO
Casey Roberts
2004-10-06 13:58:18 UTC
Permalink
Okay, I've got it to the point where I have two variables that are strings
that are the old layer and the new layer name. Both layers exist in the
drawing, but what is the syntax for feeding these to the express tools
laymrg command via lisp.

(c:laymrg)(command "T" OLDLAY "" "T" NEWLAY "Y")
doesn't work and neither does:


Command: (command "laymrg")
laymrg Unknown command "LAYMRG". Press F1 for help.
Thanks for the suggestion, it works but it's still a tedios process when
dealing with hundreds of layers in multiple drawings with varyious 'maps'
required that are not the same fore each drawing.
Post by unknown
Hi Casey. Have you already looked into the built-in laytrans command?
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO
C Witt
2004-10-06 17:27:49 UTC
Permalink
you can't use lisp to run laymrg.. you have to use script files (loaded
by lisp)..

see the attached files for an example..

HTH
Casey Roberts
2004-10-06 17:49:18 UTC
Permalink
In that case, is there a method to use a lisp variable of the layernames
within a script file?
Post by C Witt
you can't use lisp to run laymrg.. you have to use script files (loaded
by lisp)..
see the attached files for an example..
HTH
----------------------------------------------------------------------------
----
Post by C Witt
laymrg
t
scale
t
text
y
----------------------------------------------------------------------------
----
Post by C Witt
(setvar "cmdecho" 0)
(setq curlry (getvar "clayer"))(princ)
(command "-layer" "m" "scale" "c" "7" "scale" "")(princ)
(setvar "clayer" curlry)(princ)
(command "script" "laymrg.scr")(princ)
(setvar "cmdecho" 1)
cr
2004-10-06 03:00:54 UTC
Permalink
Okay, I've got most of it figured out. All I need is how to supply the
variables to the laymrg command that is packaged with express tools

variables are:
oldname ;name of old layer
newname ;name of new layer

I want to merge layer oldname onto layer newname

so far:

(c:laymrg)(command "T" OLDNAME "" "T" NEWNAME" "Y")

but it doesn't work!

any suggestions?

Thnx
Post by Casey Roberts
Does anyone have a lisp or is anyone able to point me in the right direction
for creating a lisp that will do accomplish the following.
Currently, I have a drawing with multiple layers that have been prefixed
with a drawing name (These were xref's that have been bound to the drawing I
am working with.)
There are several 'similar' layers which I would like to merge into the same
layer. The difference between the layernames is the prefix portion. Is
there a way to automate this process as typing in all the layer names is a
time consuming process.
UNIT-A-1$0$A-BALCONY
UNIT-A-1$0$A-COLUMN
UNIT-A-1$0$A-RAIL
UNIT-B-1$0$A-BALCONY
UNIT-B-1$0$A-COLUMN
UNIT-B-1$0$A-RAIL
UNIT-C-1$0$A-BALCONY
UNIT-C-1$0$A-COLUMN
UNIT-C-1$0$A-RAIL
UNIT-D-1$0$A-BALCONY
UNIT-D-1$0$A-COLUMN
UNIT-D-1$0$A-RAIL
I would like them combined into layers
A-BALCONY
A-COLUMN
A-RAIL
(this is only a small portion of the actual layer list)
TIA
Casey
C Witt
2004-10-06 22:42:43 UTC
Permalink
AFAIK you can't use that kind of command call up (and that is why it's
not working)..
Post by cr
Okay, I've got most of it figured out. All I need is how to supply the
variables to the laymrg command that is packaged with express tools
oldname ;name of old layer
newname ;name of new layer
I want to merge layer oldname onto layer newname
(c:laymrg)(command "T" OLDNAME "" "T" NEWNAME" "Y")
but it doesn't work!
any suggestions?
Thnx
Post by Casey Roberts
Does anyone have a lisp or is anyone able to point me in the right
direction
Post by Casey Roberts
for creating a lisp that will do accomplish the following.
Currently, I have a drawing with multiple layers that have been prefixed
with a drawing name (These were xref's that have been bound to the drawing
I
Post by Casey Roberts
am working with.)
There are several 'similar' layers which I would like to merge into the
same
Post by Casey Roberts
layer. The difference between the layernames is the prefix portion. Is
there a way to automate this process as typing in all the layer names is a
time consuming process.
UNIT-A-1$0$A-BALCONY
UNIT-A-1$0$A-COLUMN
UNIT-A-1$0$A-RAIL
UNIT-B-1$0$A-BALCONY
UNIT-B-1$0$A-COLUMN
UNIT-B-1$0$A-RAIL
UNIT-C-1$0$A-BALCONY
UNIT-C-1$0$A-COLUMN
UNIT-C-1$0$A-RAIL
UNIT-D-1$0$A-BALCONY
UNIT-D-1$0$A-COLUMN
UNIT-D-1$0$A-RAIL
I would like them combined into layers
A-BALCONY
A-COLUMN
A-RAIL
(this is only a small portion of the actual layer list)
TIA
Casey
DaveS
2004-10-07 11:08:12 UTC
Permalink
Sometimes doing it this way: (command "T" "!OLDNAME" "" "T" "!NEWNAME" "Y")
but only sometimes. Also you have a floating quote after the NEWNAME
variable.

here
|
(command "T" OLDNAME "" "T" NEWNAME" "Y")

Have fun,
Dave
Post by cr
Okay, I've got most of it figured out. All I need is how to supply the
variables to the laymrg command that is packaged with express tools
oldname ;name of old layer
newname ;name of new layer
I want to merge layer oldname onto layer newname
(c:laymrg)(command "T" OLDNAME "" "T" NEWNAME" "Y")
but it doesn't work!
any suggestions?
Thnx
Post by Casey Roberts
Does anyone have a lisp or is anyone able to point me in the right
direction
Post by Casey Roberts
for creating a lisp that will do accomplish the following.
Currently, I have a drawing with multiple layers that have been prefixed
with a drawing name (These were xref's that have been bound to the
drawing
Post by cr
I
Post by Casey Roberts
am working with.)
There are several 'similar' layers which I would like to merge into the
same
Post by Casey Roberts
layer. The difference between the layernames is the prefix portion. Is
there a way to automate this process as typing in all the layer names is a
time consuming process.
UNIT-A-1$0$A-BALCONY
UNIT-A-1$0$A-COLUMN
UNIT-A-1$0$A-RAIL
UNIT-B-1$0$A-BALCONY
UNIT-B-1$0$A-COLUMN
UNIT-B-1$0$A-RAIL
UNIT-C-1$0$A-BALCONY
UNIT-C-1$0$A-COLUMN
UNIT-C-1$0$A-RAIL
UNIT-D-1$0$A-BALCONY
UNIT-D-1$0$A-COLUMN
UNIT-D-1$0$A-RAIL
I would like them combined into layers
A-BALCONY
A-COLUMN
A-RAIL
(this is only a small portion of the actual layer list)
TIA
Casey
Continue reading on narkive:
Loading...