Jump to content

LISP Routine to Copy all Entities


Recommended Posts

Posted

Hi guys,

 

Does someone know a Lisp routine that draw/copy all the active/thawed entities and put that new drawing/entities in a specific layer?

 

A more specific explanation:

1- I have a drawing full of dynamic blocks, different layer, etc

2- I want to have a copy of my drawing but with all entities in a specific layer but with the exactly same shape of the original drawing.

 

I made myself clear?

 

Thanks in advance!

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

  • Filribeiro

    15

  • ReMark

    9

  • nestly

    8

  • RobDraw

    7

Top Posters In This Topic

Posted

Is this for multiple files? If it's a one shot deal, you could have done it without lisp in less time than it took you to post your question. Just curious.

Posted

Hi Rob,

 

Thanks for the quick response.

 

Is just in one file... :s

 

So, what is the solution?

 

CHeers!

Posted

Here's two non-lisp solutions;

 

- WBLOCK all the active/thawed objects to a new drawing, open the new drawing and change everything to a single layer.

 

- Use COPYTOLAYER to copy all the active/thawed objects onto a single new layer, isolate that layer, then use WBLOCK to export everything on that layer to a new drawing.

Posted

I think the quickest way would be to select all, change the layer in the properties box, and then save as.

Posted

apparently I didn't make myself understood...

 

I want to creat a different group of entities that are a copy/reproduction of all active/thawed entities BUT i want that the new entities in the same layer. furthermore, i want that the new entities are all exploded.

 

The objective is to simplify a drawing, get rid of the dynamic blocks, etc.

 

Thanks Rob

Posted
apparently I didn't make myself understood...

 

I want to creat a different group of entities that are a copy/reproduction of all active/thawed entities BUT i want that the new entities in the same layer. furthermore, i want that the new entities are all exploded.

Here's two non-lisp solutions;

 

- WBLOCK all the active/thawed objects to a new drawing, open the new drawing and change everything to a single layer, and EXPLODE

 

- Use COPYTOLAYER to copy all the active/thawed objects onto a single new layer, isolate that layer, EXPLODE, then use WBLOCK to export everything on that layer to a new drawing.

 

* edited to reduce blocks to single entities.

Posted

As soon as you use the word "explode" you are not simplify the drawing.

Posted

Uhmm... here ir the problem:

 

I have tons os dynamic blocks, and when i explode them the transform 1 in 11111111111111111111111111111 , and this ruins my drawing. SO, i want to copy/reproduce the dynamic block as it is without explode it and then a prevent the 1 to 11111111111111111111111 to you get it?

 

Think in a pen drawing on top of the original drawing, making a new one but only with simples entities (lines, circles)...get it?

 

Thanks!!!

Posted

According to what you have said so far, you have a drawing full of dynamic blocks that you want exploded. You want all the resulting entities on the same layer. You also want this drawing to be a copy of the original.

 

You've almost answered your own question. Just explode all the blocks. You can select just the blocks using QSELECT. Then select all and change the layer in the properties box and then do a SAVEAS.

 

nestly's solutions also work.

Posted

Is there something about exploding dynamic blocks that I am missing? I haven't worked with them much.

Posted

I was speaking in generalities. It is usually not a good idea to explode entire drawings or major portions thereof. But the OP is free to do just that if he wants.

Posted

Rob,

 

If i explode a dynamic block it don't stay as it was before explode command.

 

So, i can explod all the entities except the dynamic blocks which are the reason of my thread :)

 

Cheers

Posted

Can you post a file with some dynamic blocks that change when exploded? I'll take a look around and see if there is a way to have them remain as they were before exploding.

Posted
Is there something about exploding dynamic blocks that I am missing? I haven't worked with them much.

 

I don't know why exploding dynamic blocks would cause a lot of additional/overlapping objects unless the blocks have a lot of additional/overlapping objects within them to begin with. Adding OVERKILL as an additional step would solve that issue.

 

If you can post a sample drawing, I bet I can do it in 4 steps or less.

Posted

Wouldn't it depend on how complex the dynamic block was? For example, let's say it is a dynamic block of a door. The parameters might be for height and width. I would think that exploding it would not be a major problem. But what if it were a dynamic block of a toilet that had a top, front and side view (controlled by visibility states). What happens when that is exploded? See what I am getting at?

 

In regards to these "entities" the OP wants to explode let's hope none of them have any hatching as well. Exploded hatch patterns can be a bear to work with. Just saying.

Posted

i will send after lunch :P

 

Thanks mates!!

Posted
Wouldn't it depend on how complex the dynamic block was? For example, let's say it is a dynamic block of a door. The parameters might be for height and width. I would think that exploding it would not be a major problem. But what if it were a dynamic block of a toilet that had a top, front and side view (controlled by visibility states). What happens when that is exploded? .

 

What happens when it is exploded? Only the objects that are visible become exploded entities in the drawing, everything else in the dynamic block that's not visible is discarded.

Posted

I was not aware of that. Seems odd though don't you think? After all the entities were real, they did exist, so how come they get discarded?

 

Well that would certainly work in the OP's favor then. Good to know. Thanks.

Posted
I was not aware of that. Seems odd though don't you think? After all the entities were real, they did exist, so how come they get discarded?

 

Nope, not odd at all. A misconception about dynamic blocks is that it's just one block. In reality, each instance of a dynamic block in a drawing is it's own unique anonymous block based on the original block.Those anonymous blocks don't actually contain all the "invisible" geometry, they only contain the user defined parameters, and a reference back to the original "named" dynamic block. When dynamic blocks are exploded, each anonymous block is exploded individually based only on it's current parameters.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...