Jord_91 Posted February 13, 2019 Share Posted February 13, 2019 Hi guy's, those codes are great! I was looking for something similar where in my actual file it would put a point at the 4 corners only . MLE3060EMID W.dwg As i work at reducing the weight of the file i went from my 3d drawing to this 2D using a script but what'S lef is almost only line. I've tried all your lisp but it puts dots everywhere... Could you Help me to spot the corner of the "desk" Quote Link to comment Share on other sites More sharing options...
Jord_91 Posted February 13, 2019 Share Posted February 13, 2019 On 10/9/2017 at 3:26 PM, Lee Mac said: Here's another way: (defun c:pvtx ( / e i p s ) (if (setq s (ssget '((0 . "*polyline")))) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i)))) (repeat (- (setq p (fix (+ (vlax-curve-getendparam e) 1 1e-)) (logand 1 (cdr (assoc 70 (entget e))))) (entmake (list '(0 . "POINT") (cons 10 (vlax-curve-getpointatparam e (setq p (1- p)))))) ) ) ) (princ) ) (vl-load-com) (princ) FWIW, this: (- (setq p (fix (+ (vlax-curve-getendparam e) 1 1e-)) (logand 1 (cdr (assoc 70 (entget e))))) Could also be written: (+ (setq p (fix (+ (vlax-curve-getendparam e) 1 1e-)) (vlax-get (vlax-ename->vla-object e) 'closed)) But the latter will likely be slower due to vlax-ename->vla-object. Hi Lee I went to you site and found the Bounding box Reactor But it's not loading. I tought that mayby it would have been the perfect solution to outline my drawing and the add point at vertext with one of these command Quote Link to comment Share on other sites More sharing options...
dlanorh Posted February 13, 2019 Share Posted February 13, 2019 1 hour ago, Jord_91 said: Hi guy's, those codes are great! I was looking for something similar where in my actual file it would put a point at the 4 corners only . MLE3060EMID W.dwg As i work at reducing the weight of the file i went from my 3d drawing to this 2D using a script but what'S lef is almost only line. I've tried all your lisp but it puts dots everywhere... Could you Help me to spot the corner of the "desk" RE; puting dots everywhere, is PDMODE set to 0 (zero) ? If so try setting it to 3. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 14, 2019 Share Posted February 14, 2019 Bounding box will not work as you have lines, to get 4 corners join outside 1st. Pretty quick to put 4 dots on this dwg manually. You could do a min max of entities selected ie a defacto bounding box. Lastly I have shorthands for osnap so make one for osmode 1 which is end point and a normal osnaps (defun 1 ()(setvar 'osmode 1)) (defun 47 (setvar 'osmode 47)) to use type 1 point pick corner spacebar pick corner spacebar pick corner spacebar pick corner 47 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 14, 2019 Share Posted February 14, 2019 (edited) Use lee-mac Selection set bounding box. (setq box (LM:ssboundingbox (ssget))) returns the two corners. You can work out the others. Tested on your dwg. Edited February 14, 2019 by BIGAL 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.