Jump to content

Recommended Posts

Posted

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.

 

 

Posted

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.

 

 

Posted

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.

Posted

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

 

Posted

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.

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