marko_ribar Posted May 8, 2012 Share Posted May 8, 2012 Code on post #39 has been changed and updated... Sincerely, M.R. Quote Link to comment Share on other sites More sharing options...
kwwong6 Posted May 8, 2012 Author Share Posted May 8, 2012 Thank for your code. Really fast and good, but just cannot for rotated block only. I now try to make other program for all of this, maybe need some days to finish it. If good I will post out. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted November 3, 2013 Share Posted November 3, 2013 (edited) I've changed code just a little since my last post... Hope you'll now use it well... I'll attach lsp due to its size... M.R. [EDIT : Even more modified BBox.lsp - only lack are blocks within blocks and blocks that overlap each other - that's why it's advised that you save DWG and then proceed to run routine] [EDIT : It were 3 downloads till I reattached new version] BBox.lsp Edited November 3, 2013 by marko_ribar reattached lisp Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted November 3, 2013 Share Posted November 3, 2013 Lisp reattached... Regards, M.R. Quote Link to comment Share on other sites More sharing options...
Stefan BMR Posted November 4, 2013 Share Posted November 4, 2013 Hi Marko I have thinking to another way to find the limits (bounding box) of a spline. The idea is to find the limits of some projections of spline on x, y and z axis. This is a VERY limited tested version, but I think it might be useful. (defun spline_bb (e / p1 p2 d ax bb) (vla-getboundingbox (vlax-ename->vla-object e) 'p1 'p2) (setq p1 (vlax-safearray->list p1) p2 (vlax-safearray->list p2) d (distance p1 p2) p1 (mapcar '- p1 (list d d d)) p2 (mapcar '+ p2 (list d d d)) ax (mapcar '(lambda (n) (sp e n)) '((t nil nil) (nil t nil) (nil nil t))) bb (mapcar (function (lambda (p) (mapcar (function (lambda (f a n) ((eval f) (vlax-curve-getclosestpointto a (pp p n))) ) ) '(car cadr caddr) ax '((t nil nil) (nil t nil) (nil nil t)) ) ) ) (list p1 p2) ) ) (mapcar 'entdel ax) bb ) ;point projection on axis (defun pp (p n) (mapcar 'if n p '(0.0 0.0 0.0))) ;spline projection on axis (defun sp (e n) (entmakex (mapcar (function (lambda (x) (if (member (car x) '(10 11)) (cons (car x) (pp (cdr x) n)) x ) ) ) (vl-remove-if '(lambda (x) (member (car x) '(-1 5 330 67 410 8 210 62 11))) (entget e)) ) ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 4, 2013 Share Posted November 4, 2013 Excellent idea Stefan, kudos Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted November 4, 2013 Share Posted November 4, 2013 (edited) Stefan, why do you think it's very limited tested version... I think it's even better than first your code - it doesn't iterate 500 times while running... I've already implemented into my BBox.lsp and see no lack... Thanks, Stefan, you are really genius... And first code was real master piece and now this second, without (vlax-curve-getfirstderiv)... All the best, M.R. [EDIT : I forgot ab HELIXes] Reattached lisp [it was 1 download till now]... BBox.lsp Edited December 20, 2014 by marko_ribar Quote Link to comment Share on other sites More sharing options...
Elpanov Evgeniy Posted December 3, 2013 Share Posted December 3, 2013 (edited) my version: (defun test (c) ;; This code is written on the basis of code 'highflyingbird' ;; http://www.theswamp.org/index.php?topic=45785.msg509260#msg509260 (mapcar (function (lambda (p) (list (car (vlax-curve-getClosestPointToProjection c p '(0 1 0) t)) (cadr (vlax-curve-getClosestPointToProjection c p '(1 0 0) t)) (caddr (vlax-curve-getClosestPointToProjection c (reverse p) '(0 1 0) t)) ) ) ) '((-1e12 -1e12 0) (1e12 1e12 0)) ) ) (defun c:bbox (/ a) (setq a (test (car (entsel)))) (vl-cmdf "_box" "_non" (car a) "_non" (cadr a))) Edited December 4, 2013 by Elpanov Evgeniy added link Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted December 20, 2014 Share Posted December 20, 2014 I've updated my BBox.lsp... Still it's little buggy, but that depends on complexity of DWG... I think that now it's still little better than it was... You can download it from my previous post... Regards, M.R. Quote Link to comment Share on other sites More sharing options...
AIberto Posted March 10, 2015 Share Posted March 10, 2015 I've updated my BBox.lsp... Still it's little buggy, but that depends on complexity of DWG... I think that now it's still little better than it was... You can download it from my previous post... Regards, M.R. Hi ,marko, no function definition: ACET-SS-UNION ??? why? Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted March 10, 2015 Share Posted March 10, 2015 Hi ,marko, no function definition: ACET-SS-UNION ??? why? This is standard ACET-... function provided within Express Tools for ACAD... Check your installation of ACAD software and make sure you checked option for including Express Tools... Quote Link to comment Share on other sites More sharing options...
AIberto Posted March 10, 2015 Share Posted March 10, 2015 This is standard ACET-... function provided within Express Tools for ACAD... Check your installation of ACAD software and make sure you checked option for including Express Tools... Thanks marko ,I know 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.