Jump to content
Dahzee

Trim using nearest entity/entities

Recommended Posts

Dahzee

Has anybody seen a lisp file that can do as per the attached video?

 

Basically I want to trim without first selecting a cutting edge, so all I do is click the entity I want to be removed and the routine finds the nearest intersection(s).

 

So as per the video, if the entity has one intersection then the part of the entity selected is removed and if the entity has two intersections then the section you have clicked between them is deleted.

 

I use the standard Trim command all the time and I have edge mode set to on, so it is inconvenient to keep turning it off if I press enter to select all entities to trim to.

 

Hope this makes sense.

 

 

Share this post


Link to post
Share on other sites
Tharwat

Simply this:

(command "_.trim" ""  "\\")

 

Share this post


Link to post
Share on other sites
Dahzee

Hi Tharwat,

 

That is really close, is there any way for edgemode to be temporarily disabled as I always have that on and it interferes with this command?

 

Using the built in Trim command like this is great as it also works the other way round, so you can extend as well!

 

Forgot to mention that I am using Bricscad V20

 

Thanks Tharwat for the quick reply, much appreciated.

 

 

Share this post


Link to post
Share on other sites
Tharwat

You're most welcome.

 

Sorry I did not get your point that clear !

Share this post


Link to post
Share on other sites
Dahzee

Using the Trim command means that the EDGEMODE setting determines where the entities are trimmed, rather than the physical intersecting entity.

 

Because I always have EDGEMODE turned on it is affecting where the Trim is taken from.

 

How can EDGE MODE be turned off during the routine and turned back on after the routine has finished?

 

Attached video may make it clearer.

Share this post


Link to post
Share on other sites
Tharwat

Okay, please give this routine a shot.

(defun c:test (/ *error* edge)
  (defun *error* (msg)
    (and edge (setvar 'EDGEMODE edge))
    (and msg
	 (not (wcmatch (strcase msg) "*CANCEL*,*EXIT*,*BREAK*"))
	 (princ (strcat "\nError =>: " msg))
    )
    (princ)
  )
  (setq edge (getvar 'EDGEMODE))
  (setvar 'EDGEMODE 0)
  (command "_.TRIM" "" "\\")
  (*error* nil)
  (princ)
)

 

Share this post


Link to post
Share on other sites
Dahzee

Tharwat,

 

You are an absolute star!

 

Thank you very much, it works exactly as I hoped.

 

This will save me loads of time.

 

Really appreciate your help.

Share this post


Link to post
Share on other sites
Tharwat

Happy to help, you're welcome .

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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