ethangale25 Posted March 14 Share Posted March 14 Hey everyone, This could very well be simple, but I am not sure how to do it... Here is a line in my code that uses the "INTERSECT" command on four different regions: (command "INTERSECT" currentregion massiveregion arearegion currentcourseinstanceregion "") (setq intersectregion (entlast)) (setq intersectregion (vlax-ename->vla-object intersectregion)) ;convert to vlax (setq intersectarea (vla-get-area intersectregion)) In some cases, the intersect command returns the following: Command: INTERSECT Select objects: Specify opposite corner: 4 found Select objects: Null region created - deleted when there aren't any overlapping areas of the four regions. This in turn causes my lisp routine to fail at --> (setq intersectregion (entlast)) How do I "check" to see what the intersect command will return? Thanks for the help Quote Link to comment Share on other sites More sharing options...
pkenewell Posted March 14 Share Posted March 14 (edited) @ethangale25 1) For the first part, without the context of your full code and a sample drawing, it is kinda hard diagnose what is happening. 2) for the 2nd part: I recommend: a) before doing the intersect, put the last entity into a variable: (setq le (entlast)), b) then after the intersect, put the last entity into a 2nd variable: (setq le2 (entlast)). c) Then compare the handles of the two entities to see if they are the same: (= (cdr (assoc 5 (entget le))) (cdr (assoc 5 (entget le2)))). If they are the same, then the intersect did not produce anything, if they are different, then the intersect was probably successful. Edited March 14 by pkenewell Quote Link to comment Share on other sites More sharing options...
mhupp Posted March 14 Share Posted March 14 These are poly lines or some type of shape I'm guessing? The goat has you covered like always. https://www.lee-mac.com/intersectionfunctions.html#intersectionsinset Quote Link to comment Share on other sites More sharing options...
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.