Dahzee Posted February 11, 2020 Posted February 11, 2020 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. Quick Trim.mp4 Quote
Tharwat Posted February 11, 2020 Posted February 11, 2020 Simply this: (command "_.trim" "" "\\") Quote
Dahzee Posted February 11, 2020 Author Posted February 11, 2020 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. Quote
Tharwat Posted February 11, 2020 Posted February 11, 2020 You're most welcome. Sorry I did not get your point that clear ! Quote
Dahzee Posted February 11, 2020 Author Posted February 11, 2020 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. Quick Trim 2.mp4 Quote
Tharwat Posted February 11, 2020 Posted February 11, 2020 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) ) Quote
Dahzee Posted February 11, 2020 Author Posted February 11, 2020 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. Quote
Recommended Posts
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.