Extracting lines from inside a block to outside

Extracting lines from inside a block to outside

RBernaz
Advocate Advocate
1,204 Views
10 Replies
Message 1 of 11

Extracting lines from inside a block to outside

RBernaz
Advocate
Advocate

Hi all,

I have a block which I'd like to cut some entities from inside to outside the block but maintaining in the same position, more less like partial explode, maintaining the main block intact but without those chosen entities.

Is that possible?

I'm very poor on lisp and would like some help please

 

thank you in advance

0 Likes
1,205 Views
10 Replies
Replies (10)
Message 2 of 11

Kent1Cooper
Consultant
Consultant

No AutoLisp is needed.  Use REFEDIT, pick the Block, and you will see this option:

Kent1Cooper_0-1694715255025.png

which will leave what is removed where it is, but "outside" the Block.  Keep in mind that it will remove the same parts from all insertions of that same Block, but will not leave copies of them at each location, only at the location of the Block insertion in which you do the REFEDITing.

Kent Cooper, AIA
0 Likes
Message 3 of 11

JBerns
Advisor
Advisor

I was going to suggest the NCOPY (Nested Copy) command, but you are trying to accomplish this with AutoLISP.

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Message 4 of 11

Kent1Cooper
Consultant
Consultant

@JBerns wrote:

I was going to suggest the NCOPY (Nested Copy) command, but ....


... but that doesn't remove them from the Block definition [see Message 1].

Kent Cooper, AIA
0 Likes
Message 5 of 11

RBernaz
Advocate
Advocate

Hi, thank you for your help.

 

The problem is that I have more than 500 blocks like this in the drawing. I have to do it in a massive way, that's why I thought that a lisp routine could make it

0 Likes
Message 6 of 11

hosneyalaa
Advisor
Advisor

Can you attached example drawing 

0 Likes
Message 7 of 11

RBernaz
Advocate
Advocate

here it goes, I would like to maintain de dynamics inside

0 Likes
Message 8 of 11

JBerns
Advisor
Advisor

@Kent1Cooper,

 

I misinterpreted the OP's  message regarding "cut" and "maintaining the main block intact".

So the block definition is unaltered. Its the insertions that need the "partial explode".

 

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Message 9 of 11

Kent1Cooper
Consultant
Consultant

@RBernaz wrote:

... I have more than 500 blocks like this in the drawing. I have to do it in a massive way, ....


Let's say, for example, you have 500 Blocks with a Line in them that you want pulled out.  Do you want that Line removed from the Block definition and also put into the drawing independent of the Block at all 500 insertions of it, not just at one of them?

 

If so, removing the Line under REFEDIT won't do -- it will remain at the location of the insertion that you REFEDITed, but will simply disappear from 499 of them.

 

And removing it under REFEDIT won't do for dynamic Blocks, either -- it will make a new and different Block from the one you do it in, but won't affect other insertions.

 

If the Block is not dynamic, a routine could presumably be written to pull the Line out of the Block definition, define a new Block including both the revised old Block and that Line, replace all insertions of the old Block with the new one, and Explode each of them to leave the revised old Block and the Line at every location.

 

If it's dynamic, with different values of the dynamic properties at different insertions, I'm not sure whether it's solvable -- I don't work with dynamic Blocks enough, but maybe someone more experienced with them will chime in.  You can pull the Line out with BEDIT, but putting it into the drawing independent of the Block at every location would be tricky if there are different scale factors and/or rotations involved.  Maybe it would work to define the Line alone into a Block with the same insertion point as the original, and put that in at every location using the original Block's insertion point and scale factors/rotation, and Explode each to leave just the Line.

Kent Cooper, AIA
0 Likes
Message 10 of 11

RBernaz
Advocate
Advocate

Yes I understand, probably isn't achievable.

But thank you anyway.

 

 

 

 

0 Likes
Message 11 of 11

Sea-Haven
Mentor
Mentor

A complex block,  the text maybe pull out and set attribute to invisible, so its still there but not seen.

Similar with the lines reproduce them, then set original lines to a no plot layer, again will see but will not plot. 

Like Kent maybe have a big think about what your trying to achieve you may have gone a couple of steps to far. Rather than having more than 1 block at same point.

0 Likes