• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

explode a block contained in another block

  • Thread starter Thread starter rdilecce80
  • Start date Start date

rdilecce80

Guest
Hey, guys.
Good parties to all.
I have a problem never happened in autocad.
cream dime for skin cutting.
every dime in autocad is a block to itself.
this time, however, I got a file that contains all the blades but, within the blades there are the famous heels that, however, are "blocks in the blocks" or, the notch is a line but a block.
Since they're 280 dimes and I have to save them in dxf and then import them into the specific program, I'd need to explode only the heel block.
final result for each dime, will be a set of lines, txt and polylinee grouped in a block.

by hand the procedure is:
1 - open block "dima1" in block editor
2 - Explodes block "tacca"
3 - close and save.

thank you to anyone who could disappoint me on this question
 
select all tack blocks using the _filter commands
_filter launches, choose from the drop-down menu "block name" (or block name) and write in the caselline your notches, then add.
done this when you give ok acad allows you to select all the dwg and he discards the blocks of name notches, leaving you as selection all the blocks notches.
from an explode and to the selection objects answer with a p (previous) et voilà the game is made.
 
Thanks for the answer.
does not act :

Then:
1. there are 280 blocks each with its own name (e.g. block1; block2; block3... )
2. each block is formed by a polylinea, a txt and another block called notchs2 (which is the famous notch)
3. I go into filter - block name - add notchs2 block - apply - tells me: select objects.
4. I try to select all the blocks but tells me: 0 found
 
your command is valid if all 280 blocks have exploded but to filter only the block in the block, it does not go
 
waiting for in lisp I suggest an escamotage, which may not be quick though:
enter the block you want to explode
insert a figure that highlights it from the rest of the drawing as a circle of a color not present or on a dedicated layer
get out of the block saving it
now you have all the blocks containing the block to explode
select a circle and change the first level block where you explore the contents and delete the circle. to speed up the procedure associates the doubleclick on the block its modification.
 
waiting for in lisp I suggest an escamotage, which may not be quick though:
enter the block you want to explode
insert a figure that highlights it from the rest of the drawing as a circle of a color not present or on a dedicated layer
get out of the block saving it
now you have all the blocks containing the block to explode
select a circle and change the first level block where you explore the contents and delete the circle. to speed up the procedure associates the doubleclick on the block its modification.
hmm already tried to put all the heels on a layer entering the notchs2 block. If I turn off all levels except that, it actually makes me see only the heels but I can't explode them otherwise every single block explodes:frown:
 
already tried to put all the heels on a layer entering the notchs2 block
That's not what I wrote.
however that is also a valid system; identifying the notchs2 block you enter into modification of the block that contains it and you can explode notchs2.
using the command modifrif you work without entering the block management mode allowing a greater speed of execution.
as you see in the image with the command modifrif opens a window showing the editable blocks at multiple levels and you can decide on which to act; in the case concerned you will select the upper one to notchs2 thus being able to explode the block inside it. you go out with the command chiudirif that saves the blockImmagine.webp
 
Thank you very much for the answers.
Now I begin so waiting for some good souls that create a lisp to greatly accelerate the work.

I disabled all layers except the "4" so that it should not always zoom on each piece :rolleyes:

Good New Year! :finger:
 
Try this program that only explodes the heels, without exploding the blades. the required selection is only for the blocks. blocks that do not contain notchs2 not being treated.
Code:
(defun c:esptac (/ blocks gru dima index listadima count)
(setq blocks(vla-get-blocks (vla-get-activedocument(vlax-get-acad-object))))
gru(ssget '((0 . "insert")))
)
(repeat (setq index(sslength gru))
(setq dima(ssname gru (setq index(1- index))))
listadima(vla-item blocks (cdr(assoc 2))))
count 0
)
(vlax-for elem listadima
(if (and (equal (vla-get-objectname (vla-item listadima count)) "acdbblockreference")
(equal (vla-get-name (vla-item listadima count)) "notchs2")
)
(vla-item listadima count)
)
(setq count(1+ count))
)
)
)
 
confutatis, thank you very much for the answer.

Is it a lips or should I put it in vba?

If vba how can I insert it? I'm not really scheduling. Excuse me.
 
I tried to create a lisp called esptac.

I uploaded it but the following error comes out:
command: _appload esptac.lsp caricato.
command:
command:
command: esptac
; errore: no function definition: vlax-get-acad-object

uso autocad 14 64bit su win7
 
Last edited:
after a google search, I came to conclusion that you had to add the line (vl-load-com) and works.

Full code:
(defun c:esptac (/ blocks gru dima index listadima count)(vl-load-com)(setq blocks(vla-get-blocks (vla-get-activedocument(vlax-get-acad-object))))
gru(ssget '((0 . "insert")))
)
(repeat (setq index(sslength gru))
(setq dima(ssname gru (setq index(1- index))))
listadima(vla-item blocks (cdr(assoc 2))))
count 0
)
(vlax-for elem listadima
(if (and (equal (vla-get-objectname (vla-item listadima count)) "acdbblockreference")
(equal (vla-get-name (vla-item listadima count)) "notchs2")
)
(vla-item listadima count)
)
(setq count(1+ count))
)
)
)
problem solvedthank you so much to all for patience and support
 
I see you canceled your request to insert the exploded notch on the "4" layer. this version solves the problem
 

Attachments

Yes, I had deleted the request to insert the exploded notch on the layer "4" because I went into the notchs2 block, I manually inserted it on layer 4 and everything works.
I then tried this last lsp you sent me but does not automantly put them on layer 4. cmq doesn't matter.
for me the important thing was to explode the heels all together and not one block at a time.

Thank you very much for everything:
 
to the limit, if you want to change the layer, just change the line (vla-put-layer listent "4"), where "4" is the name of the layer
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top