Jump to content

Separating a component from an existing block


isutheparambil

Recommended Posts

Hi friends,

 

I am looking for a solution to split a specific part from an existing block (as a normal cad object) as i used the same block in my drawing that more than 100 times.

 

I know that component how to make for editing within the block if that is a Dynamic Block.

 

But now i need that component separate from the block itself as a normal cad entity, and the remain part as a block same as before (without the separated entity).

 

If some one have an idea how can do this, please let me know...

Edited by isutheparambil
edit
Link to comment
Share on other sites

 

Hi rlx,

 

Thank you for your prompt reply.

The lisp you provided is a nice one from Lee Mac.

Unfortunately for my inquiry its not work.

I don't need to remove any parts from the drawing.

I need to replace a part from the block to the drawing.

from the provided lisp, the command remove will removing the component permanently.

I need to remain the component on the drawing on place and do not need exist on the block itself.

Link to comment
Share on other sites

Hi rlx,

 

Thank you for your prompt reply.

The lisp you provided is a nice one from Lee Mac.

Unfortunately for my inquiry its not work.

I don't need to remove any parts from the drawing.

I need to replace a part from the block to the drawing.

from the provided lisp, the command remove will removing the component permanently.

I need to remain the component on the drawing on place and do not need exist on the block itself.

 

 

Lee has many programs , also this one : http://www.lee-mac.com/upgradedburst.html

 

 

This might be closer to what you want. I suppose his program can be modified in such a way it does exactly what you want but I rather let Lee do that because he's the author (and smarter)

Link to comment
Share on other sites

Please provide a copy of the block in question as a .dwg file. Indicate what has to be removed as well as what has to remain. Also specify block name(s) where applicable. An image file is of no use. It must be a .dwg file.

Link to comment
Share on other sites

Lee has many programs , also this one : http://www.lee-mac.com/upgradedburst.html

 

 

This might be closer to what you want. I suppose his program can be modified in such a way it does exactly what you want but I rather let Lee do that because he's the author (and smarter)

 

Yes ..You are right

As Lee is the author, he can o something on it.

Link to comment
Share on other sites

Please provide a copy of the block in question as a .dwg file. Indicate what has to be removed as well as what has to remain. Also specify block name(s) where applicable. An image file is of no use. It must be a .dwg file.

 

Hi Re mark..

 

At present I left from my office.

Once I reach tomorrow in to office, of course I will post the drawing.

 

Thanks Re mark..

Link to comment
Share on other sites

Please provide a copy of the block in question as a .dwg file. Indicate what has to be removed as well as what has to remain. Also specify block name(s) where applicable. An image file is of no use. It must be a .dwg file.

 

Hi Re Mark,

 

I am attaching a portion from my drawing because of the size of file is very high.

I have the blocks named 'EM' and 'WM' more than 1000 times in my drawing.

 

My requirement is below.

 

i need to work on the block "WM" which is an attribute block by color BLUE.

 

I have to split the lines colored "GREEN", "YELLOW" and "CYAN" from the BLUE BOX, and the block wants remain with the BLUE box and WM text only.

 

This means I don't need to delete the line from the block. i need the spitted lines which "GREEN,YELLOW and CYAN" remain on the drawing as a pline single objects.

 

If this done, I can edit those lines individually from the drawing as per my requirement.

 

I hope you got my points clearly.

 

Remain with kind regards....:):):)

TEST BLOCK.dwg

Link to comment
Share on other sites

Here's a quick one:

(defun c:foo (/ o s)
 (if (tblobjname "block" "wm")
   (progn
     (if (setq s (ssget "_x" '((0 . "insert") (2 . "wm,`*U*"))))
(foreach b (mapcar 'cadr (ssnamex s))
  (cond	((= "WM" (vla-get-effectivename (setq o (vlax-ename->vla-object b))))
	 (foreach e (vlax-invoke o 'explode) (and (= 256 (vla-get-color e)) (vla-delete e)))
	)
  )
)
     )
     (vlax-for	b (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) "WM")
(if (/= 256 (vla-get-color b))
  (vla-delete b)
)
     )
     (command "_.attsync" "name" "wm")
   )
 )
 (princ)
)
(vl-load-com)

Edited by ronjonp
Link to comment
Share on other sites

Here's a quick one:

(defun c:foo (/ o s)
 (if (tblobjname "block" "wm")
   (progn
     (if (setq s (ssget "_x" '((0 . "insert") (2 . "wm,`*U*"))))
(foreach b (mapcar 'cadr (ssnamex s))
  (cond	((= "WM" (vla-get-effectivename (setq o (vlax-ename->vla-object b))))
	 (foreach e (vlax-invoke o 'explode) (and (= 256 (vla-get-color e)) (vla-delete e)))
	)
  )
)
     )
     (vlax-for	b (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) "WM")
(if (/= 256 (vla-get-color b))
  (vla-delete b)
)
     )
     (command "_.attsync" "name" "wm")
   )
 )
 (princ)
)
(vl-load-com)

 

Hi ronjonp,

 

Its amazing.... I got the actual requirement for the current cad file with "WM" block.

 

Anyway, This is only work for the "WM" block... correct?

What we need to do to get a global lisp for all blocks?

 

From the lisp, I understand that rename the block name and details from the lisp itself with a new name and details for a new requirement, is OK for any other file.

 

If the lisp is for a general one is much better.

 

Thank you for your valuable information.

 

With Kind Regards....:):D:D:D

Link to comment
Share on other sites

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