lisp to copy all entities to layer with a suffix

lisp to copy all entities to layer with a suffix

allanthebruce
Advocate Advocate
2,353 Views
23 Replies
Message 1 of 24

lisp to copy all entities to layer with a suffix

allanthebruce
Advocate
Advocate

Hi There, 

Wondering if its possible to duplicate all layers (that have entities and those entities) in a drawing to layers of the same name but with a suffix. e.g. _2D and then flatten all layers that have _2D in layer name?

Thanks

Al

0 Likes
2,354 Views
23 Replies
Replies (23)
Message 2 of 24

john.uhden
Mentor
Mentor
Yes, it is possible. Have you tried making a Lisp routine to do it?

John F. Uhden

0 Likes
Message 3 of 24

allanthebruce
Advocate
Advocate

HI John,

I don't know the first thing about lisp I am afraid. I work for a surveying firm and we were thinking we'd like to have a duplicate layer of everything in 3d to be copied to a layer of the same name (suffix 2d) but flattened to a polyline in 2D.

Any help is appreciated.

Thanks

Al

0 Likes
Message 4 of 24

john.uhden
Mentor
Mentor
Do you need both 3D and 2D in the same drawing? Maybe it would be better to flatten everything in the 3D drawing and then save as to DrawingX_2D.dwg.

John F. Uhden

0 Likes
Message 5 of 24

allanthebruce
Advocate
Advocate

HI John,

I thought of that but it would be best in the one drawing.

e.g.

LAYERS

TOP OF KERB_3D

TOP OF KERB_2D

 

So a lisp to copy the 2D layer as well as all entities and flatten them to polylines.

All layers with elements in one go not just a layer at a time.

Cheers

Al

0 Likes
Message 6 of 24

john.uhden
Mentor
Mentor
Contrary to my code of standards, I have an urge to write what you want. I have a soft spot for surveyors. My father was one and I think you guys/gals don't get enough respect or pay.

Are you related to Robert The Bruce? Where are you located.? I'm in NJ, USA, and around here we spell kerb as curb.

John F. Uhden

0 Likes
Message 7 of 24

allanthebruce
Advocate
Advocate

Hi John,

Any help is appreciated.

We are moving into the world of Surveying point clouds, using a laser scanner. hence the ability to have both 2 and 3D layers. I'm down under in Sydney. Scottish parents so my mum use to call me Allan the Bruce!!

Any help is appreciated as I know the value of time.

Cheers

Again

Al

 

 

0 Likes
Message 8 of 24

john.uhden
Mentor
Mentor
Ya know, one of the most brilliant and helpful guys in this forum was Steve
Johnson from Australia. I also made a friendship with a fella named Laurie
Comerford from Australia, who actually came to visit me. I also think that
Rod Laver is the best tennis player of all time.

If I find some extra time, I'll play with this thing for you. BTW, when
you spoke of polylines, do you use 3D polylines, and for what? I wouldn't
think you would want to move contours to elevation 0. Are you using Land
Desktop or Civil 3D?

John F. Uhden

0 Likes
Message 9 of 24

allanthebruce
Advocate
Advocate

Hi John,

I know of Laurie he helped me when I use to use LDD I know use Civil3d and we like to use 3d polylines for Virtual Surveying and want to keep everything 3d except for a 2d layer just for the line work for easy measuring and hatching. We always want to keep contours at their true value its crazy how sometimes we recieve files all flattened!!

Agree Rod Laver the best ever, Like don Bradman for cricket!!

 

Cheers mate

Al

 

0 Likes
Message 10 of 24

john.uhden
Mentor
Mentor

I found an old routine that changes everything (normal AutoCAD objects including attributes) to elevation zero, but I think you want to limit the selection to exclude contours and such, right?  I don't have C3D installed, so I don't know what object names to avoid like figures.  Can you give me a list of exact entity names?

 

NE John Uhden and Laurie.JPG

John F. Uhden

Message 11 of 24

Anonymous
Not applicable
Hi John,

Are you in photo ? Blue or white ^_^
0 Likes
Message 12 of 24

john.uhden
Mentor
Mentor
That's Laurie Comerford from Australia on the left (in blue) and myself on
the right (in white) in 2001 at my home in NJ.

John F. Uhden

0 Likes
Message 13 of 24

Anonymous
Not applicable

You are look like friendly, funny and easy going. I like it. ^_^

0 Likes
Message 14 of 24

Anonymous
Not applicable
Sorry for interrupting the story. ^_^
0 Likes
Message 15 of 24

allanthebruce
Advocate
Advocate

Wow Great shot!!

I guess the entities are LWpolylines and polylines and maybe lines.

Don't worry about contours they are apart of the surface so I don't think they we get selected (civil3d)

Hope this shed some light.

Cheers again mate

Al

 

0 Likes
Message 16 of 24

john.uhden
Mentor
Mentor
It probably doesn't matter but I presume that all the target entities are
in ModelSpace, Right?

You're not going to ask me to dig into XRefs, are you?

Okay, rather than a list of what to exclude, the list to exclusively
include is...
Lines, Circles, 2D Polylines, Text, Block insertions (including
attributes), Hatches, Solids, Ellipses, and Henways.

Please correct me if I've missed something.

John F. Uhden

0 Likes
Message 17 of 24

allanthebruce
Advocate
Advocate

Hi John,

No I think you have nailed it.

Cheers

Allan

0 Likes
Message 18 of 24

john.uhden
Mentor
Mentor
Are you sure about the henways?

John F. Uhden

0 Likes
Message 19 of 24

allanthebruce
Advocate
Advocate

Whats a henway?

0 Likes
Message 20 of 24

john.uhden
Mentor
Mentor
About 5 lbs. 🙂

John F. Uhden

0 Likes