Guest kruuger Posted August 27, 2010 Posted August 27, 2010 Hello Is there any lisp routine to find overlapping dimension (like on picture below) It's hard to see dim's like this. It happen very often when we use DIMCONTINUE. And it cause big problem in manufacturing process. Someone can help:( Thank you Kruuger Quote
Michaels Posted August 27, 2010 Posted August 27, 2010 Try the command overkill That might help you a lot. Quote
Guest kruuger Posted August 28, 2010 Posted August 28, 2010 Hi Michaels I know overkill but this is not exactly what i want. OV delete dims. We need to play with fuzz distance. I'm not so good in lisp to fix OV to work for me thanks kruuger Quote
Tharwat Posted August 28, 2010 Posted August 28, 2010 You can use this code to select all dimensions according to their style name , (sssetfirst nil(ssget "_X" '((0 . "DIMENSION")(3 . "[color="red"][b]YourStyleName[/b][/color]")))) Tharwat Quote
Guest kruuger Posted August 28, 2010 Posted August 28, 2010 You can use this code to select all dimensions according to their style name , (sssetfirst nil(ssget "_X" '((0 . "DIMENSION")(3 . "[color=red][b]YourStyleName[/b][/color]")))) Tharwat my all dims are with the same style. what i want achive is too find these overlap dims (maybe flag them) and of course correct these mistakes. kruuger Quote
Lee Mac Posted August 28, 2010 Posted August 28, 2010 You could check for intersections between the dimensions, however this method will only use the boundingbox of the dimensions and so will not be 100% accurate. To demonstrate my point, try this code on two overlapping dimensions: (defun c:test ( / e1 e2 ) (vl-load-com) (if (and (setq e1 (LM:SelectifFoo (lambda ( x ) (eq "DIMENSION" (cdr (assoc 0 (entget x)))) ) "\nSelect First Dimension: " ) ) (setq e2 (LM:SelectifFoo (lambda ( x ) (eq "DIMENSION" (cdr (assoc 0 (entget x)))) ) "\nSelect Second Dimension: " ) ) ) (foreach x (LM:GroupbyNum (vlax-invoke (vlax-ename->vla-object e1) 'IntersectWith (vlax-ename->vla-object e2) AcExtendNone ) 3 ) (command "_.point" "_non" x) ) ) (princ) ) ;;-------------------=={ Select if Foo }==--------------------;; ;; ;; ;; Continuous selection prompts until the predicate function ;; ;; foo is validated ;; ;;------------------------------------------------------------;; ;; Author: Lee McDonnell, 2010 ;; ;; ;; ;; Copyright © 2010 by Lee McDonnell, All Rights Reserved. ;; ;; Contact: Lee Mac @ TheSwamp.org, CADTutor.net ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; foo - predicate function taking ename argument ;; ;; str - prompt string ;; ;;------------------------------------------------------------;; ;; Returns: selected entity ename if successful, else nil ;; ;;------------------------------------------------------------;; (defun LM:SelectifFoo ( foo str / e ) ;; © Lee Mac 2010 (while (progn (setq e (car (entsel str))) (cond ( (eq 'ENAME (type e)) (if (not (foo e)) (princ "\n** Invalid Object Selected **")) ) ) ) ) e ) ;;-----------------=={ Group by Number }==--------------------;; ;; ;; ;; Groups a list into a list of lists, each of length 'n' ;; ;;------------------------------------------------------------;; ;; Author: Lee McDonnell, 2010 ;; ;; ;; ;; Copyright © 2010 by Lee McDonnell, All Rights Reserved. ;; ;; Contact: Lee Mac @ TheSwamp.org, CADTutor.net ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; l - List to process ;; ;; n - Number of elements by which to group ;; ;;------------------------------------------------------------;; ;; Returns: List of lists, each of length 'n' ;; ;;------------------------------------------------------------;; (defun LM:GroupByNum ( l n / a b ) ;; © Lee Mac 2010 (while l ( (lambda ( i ) (while (< 0 i) (setq a (cons (car l) a) l (cdr l) i (1- i)) ) (setq b (cons (reverse a) b) a nil) ) n ) ) (reverse b) ) 1 Quote
David Bethel Posted August 28, 2010 Posted August 28, 2010 That one is pretty much bad drafting habits. Continuations should be just that. A continuation in the same direction of the previous dim. Not overlays. -David Quote
Guest kruuger Posted August 30, 2010 Posted August 30, 2010 Thanks Lee for the code. Probably now this needs to be combined with checking of DXF code for dim's to see if the dimensions are continued, maybe one dim include another etc. Is it possible to make reactor for DIMCONTINUE command? After command we move cursor to the left or right side of dimension and new dimension flip to correct side. kruuger Quote
Lee Mac Posted August 30, 2010 Posted August 30, 2010 I'm afraid the IntersectWith method is as far as I'm willing to pursue this. Quote
Guest kruuger Posted June 10, 2011 Posted June 10, 2011 old thread but finally wrote something. not beauty but it is working thanks to Lee for (LM:RotatePointsByMatrix) kruuger FindOverlappedDimensions.lsp 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.