Trim Inside Block

Trim Inside Block

Anonymous
Not applicable
2,992 Views
14 Replies
Message 1 of 15

Trim Inside Block

Anonymous
Not applicable

If anyone cane help me to get lisp to trim lines or polylines inside block without edit block itself, it will be appreciated.

0 Likes
Accepted solutions (1)
2,993 Views
14 Replies
Replies (14)
Message 2 of 15

ВeekeeCZ
Consultant
Consultant

LISP does not do magic. These lines either are part of a block or are not. So either you change the block or create a copy or block or just copy of the line (ncopy)... so what is it.

0 Likes
Message 3 of 15

john.uhden
Mentor
Mentor

Trim to what?

Block definitions don't necessarily contain cutting edges around their perimeter.

But if you used the block editor and drew a temporary polyline to represent the cutting edge, then we could help you write some code to accomplish what you want.  How much AutoLisp experience do you have?

If none, then I suggest that when using the block editor that you Trim Fence.  It's the easiest way because you probably don't want to have to select each object to trim separately.

John F. Uhden

0 Likes
Message 4 of 15

Sea-Haven
Mentor
Mentor

Post a image or dwg showing what you want, people are guessing what you want.

0 Likes
Message 5 of 15

Anonymous
Not applicable

Thanks Dears

 

Just I need to trim line in block by yellow line without edit block.

0 Likes
Message 6 of 15

Anonymous
Not applicable

Usually you give me great lisps, many many thanks😍 @ВeekeeCZ 

0 Likes
Message 7 of 15

hak_vz
Advisor
Advisor

For what you need command XCLIP will do the work.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 8 of 15

Anonymous
Not applicable

Yes, but I need to trim it not hid only.

0 Likes
Message 9 of 15

hak_vz
Advisor
Advisor

 In that case, as advised above, edit your block

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 10 of 15

ВeekeeCZ
Consultant
Consultant
Accepted solution

Just be aware that this will modify ALL instances of this block (say valve) in your drawing. 

 

(defun c:TrimRef ()

  (if (ssget "_I" '((0 . "INSERT")))
    (command "_.-REFEDIT" "_Ok" "_All" "_No")
    (command "_.-REFEDIT" pause "_Ok" "_All" "_No"))
  (initcommandversion)
  (command-s "_.TRIM")
  (command "_.REFCLOSE" "_Save")
  (princ)
  )

 

0 Likes
Message 11 of 15

Anonymous
Not applicable
I was sure you would solve it, many thanks. 

 

0 Likes
Message 12 of 15

Sea-Haven
Mentor
Mentor

If you want to do this often then make the block a dynamic block with the end points of the vertical line set as a variable distance then can change the length to match the yellow line.

 

Ok 1st thing reset block insert pt to be central point. Then can set distance easy. Pick block pick line get perp distance and reset the line length, all done.

0 Likes
Message 13 of 15

traiduong014969
Collaborator
Collaborator

DEAR SIR,

I tried your lisp code. It works perfectly with bock that create manual. However, with my block export automatic. I do not trim them. You can tell me the reason and update your code to it. I attached an example DWG file.

 Thank you !

0 Likes
Message 14 of 15

ВeekeeCZ
Consultant
Consultant

Sorry, no experience with 3D blocks.

If the blocks being anonymous is the only issue, you can try to convert them to non-anonymous.

0 Likes
Message 15 of 15

traiduong014969
Collaborator
Collaborator
Yes, it works so good, thank you for reply
0 Likes