Jump to content

Recommended Posts

Posted

1-Are there any lisp to fix all block in dwg in one command???

2-what is diffrences between fix and norm the block?

3-what we tend to fix block???:roll:

Posted
1-Are there any lisp to fix all block in dwg in one command???

2-what is diffrences between fix and norm the block?

3-what we tend to fix block???:roll:

 

1.Redefine the block [bedit/via insert]

2.Dont know what that means

3.Dont know what that means

Posted

thanx of both

1--I wanna with lisp for all blocks that all object in the blocks move to layer 0.

2--I have a huge dwg file and i audit and purge it (about 12mb) ...when i want merge some layers dont act well lyrmrg command . there are some blocks there and i wanna fix them by step 1 ...

Posted
thanx of both

1--I wanna with lisp for all blocks that all object in the blocks move to layer 0.

2--I have a huge dwg file and i audit and purge it (about 12mb) ...when i want merge some layers dont act well lyrmrg command . there are some blocks there and i wanna fix them by step 1 ...

So, if I understand correctly, you have some (or a lot of) blocks that are defined with objects on layers other than layer 0, and you want to redefine these blocks (or all of the blocks in the drawing) via LISP to place all of those objects in the block definitions on layer 0. This will then allow you to purge the affected layers, assuming this is the only problem with those layers. In other words,

 

1. Go through all of the blocks in a drawing

2. For each block, place all of its entities on layer 0

3. Update all of the block insertions in the drawing

 

Question: Are there any xrefs that will prevent this from allowing you to purge the drawing afterward?

Posted

thanx neophoible

So, if I understand correctly, you have some (or a lot of) blocks that are defined with objects

on layers other than layer 0, and you want to redefine these blocks (or all of the blocks in the drawing)

via LISP to place all of those objects in the block definitions on layer 0. This will then allow you to purge

the affected layers, assuming this is the only problem with those layers. In other words,

1. Go through all of the blocks in a drawing

2. For each block, place all of its entities on layer 0

3. Update all of the block insertions in the drawing

Yes exsactly , u understand correctly and i wanna 3 step above by one lisp code run for all blocks in dwg file .are there any code for it??:huh:

Posted (edited)
thanx neophoible

 

Yes exsactly , u understand correctly and i wanna 3 step above by one lisp code run for all blocks in dwg file .are there any code for it??:huh:

Did you look at the links I provided? The third may be your best option, but you might take a look at all of them for the discussion. Edited by neophoible
it was a question
Posted
thanx of both

1--I wanna with lisp for all blocks that all object in the blocks move to layer 0.

2--I have a huge dwg file and i audit and purge it (about 12mb) ...when i want merge some layers dont act well lyrmrg command . there are some blocks there and i wanna fix them by step 1 ...

 

When you're done with step 1 , I'm guessing step 2 [lyrmrg] wont be a problem then.

Posted

Lyrmrg dont work in my files i dont know exactly why, but it sounds my block in dwg files must be fix (object move to layer 0),,,,,and there are a lot of block there and i must looking for lisp that fix all blocks first.

Posted

The shortcall for LAYER MERGE is LAYMRG, not LYRMRG, or at least it has been for the last few years,

unless it has been changed in 2014. :|

Posted
Use SETBYLAYER command.

 

BINGO! :winner: :beer:

Posted
Lyrmrg dont work in my files i dont know exactly why, but it sounds my block in dwg files must be fix (object move to layer 0),,,,,and there are a lot of block there and i must looking for lisp that fix all blocks first.
I'm mentioning this for the third time now--Did you look at the links in post #6 above?
Posted
The shortcall for LAYER MERGE is LAYMRG, not LYRMRG, or at least it has been for the last few years,

unless it has been changed in 2014. :|

 

The only thing that change is my eyesight :lol: it is indeed LAYMRG.

 

Use SETBYLAYER command.

 

SETBYLAYER wont change the objects layer inside the block.

Posted

Dear neophoible

I'm mentioning this for the third time now--Did you look at the links in post #6 above?

I try 3 link you are mentioned them and unfortunately the suggestion lisp working with one block at time not together .

Posted
Dear neophoible

 

I try 3 link you are mentioned them and unfortunately the suggestion lisp working with one block at time not together .

Did you try all of the offered solutions in all three of the links? What about bl0.lsp? What about fixall.lsp? What were the results? Of course, I always recommend trying any solutions on sample drawings, and NOT on any original, only copy DWGs!
Posted (edited)

Try this Lisp. It isn't mine, I copied it somewhere long time ago. The credits should go to the autor because for me this LISP works like magic. :)

Read the commands properly and follow them. Or you can miss some steps.

 

(defun C:FixBlock (/ ss cnt idx blkname donelist Grp Update)
 (defun Grp (gc el) (cdr (assoc gc el)))
 (defun Update (bname / ename elist)
   (setq ename (tblobjname "BLOCK" bname))
   (if
     (and ename (zerop (logand 52 (Grp 70 (entget ename '("*"))))))
     (progn
       (while ename
         (setq elist (entget ename '("*"))
               elist (subst '(8 . "0") (assoc 8 elist) elist)
               elist (if (assoc 62 elist)
                       (subst '(62 . 0) (assoc 62 elist) elist)
                       (append elist '((62 . 0)))))
         (entmake elist)
         (setq ename (entnext ename)))
       (if (/= "ENDBLK" (Grp 0 elist))
         (entmake '((0 . "ENDBLK") (8 . "0") (62 . 0))))
       'T))
 )
 (if (> (logand (Grp 70 (tblsearch "layer" "0")) 1) 0)
   (princ "\nLayer 0 must be thawed before running FIXBLOCK!\n")
   (progn
     (if
       (progn
         (princ "\nPress <Enter> to fix all defined blocks\n")
         (setq cnt 0
               ss (ssget '((0 . "INSERT")))))
       (progn
         (setq idx (sslength ss))
         (while (>= (setq idx (1- idx)) 0)
           (if (not (member (setq blkname (Grp 2 (entget (ssname ss idx)))) donelist))
             (progn
               (if (Update blkname) (setq cnt (1+ cnt)))
               (setq donelist (cons blkname donelist))))))
       (while (setq blkname (Grp 2 (tblnext "BLOCK" (not blkname))))
         (if (Update blkname) (setq cnt (1+ cnt)))))
     (princ (strcat "\n" (itoa cnt) " block" (if (= cnt 1) "" "s") " redefined\n"))))
 (princ)
(command "setbylayer" "y" "y")
)

Edited by SLW210
Posted

So thanxxxxxxxxx to all

speacially leemac neophoible and Amalgama

the suggestion lisp for fix block is great --fixall.all and ,,

but my drawing is huge and laymrg at the pogrom dont act well and is stopped -that give me some error when i looking for that error noticed that related to the style font of drawing---it means that donot act well although i fixed my block.

Posted
So thanxxxxxxxxx to all

speacially leemac neophoible and Amalgama

the suggestion lisp for fix block is great --fixall.all and ,,

but my drawing is huge and laymrg at the pogrom dont act well and is stopped -that give me some error when i looking for that error noticed that related to the style font of drawing---it means that donot act well although i fixed my block.

You are welcome, hosyn. Hope you can get it working. Not sure what to do about the font. If nothing else, perhaps you can break out parts of your drawing into separate drawings, then reassemble once you've gotten everything worked out.

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...