How to divide dimension line in points

How to divide dimension line in points

miroslav.pristov
Advocate Advocate
5,585 Views
21 Replies
Message 1 of 22

How to divide dimension line in points

miroslav.pristov
Advocate
Advocate

Hello all again i have some question for you experts

 

I have some dimension line from point A to B. I need that line to be divided like on the picture in points i define on drawing 

. can someone help me on this please. I cant find solution for this. I try the whole morning. here is the picture

 

help.png

0 Likes
Accepted solutions (2)
5,586 Views
21 Replies
Replies (21)
Message 21 of 22

ВeekeeCZ
Consultant
Consultant
Accepted solution

@Kent1Cooper wrote:

That should be achievable without drawing a temporary Line, something like this [untested]:
    ....


I guess a temp line made the sence at the time... but you're right, thx.

 

(defun c:SplitDims (/ sel newpt ent edata elist def1 def2)
  
  (command "_.UCS" "_W")
  
  (if (and (setq sel (entsel "\nSelect Dimension to Split: "))
	   (setq def1 (cdr (assoc 13 (entget (car sel))))
		 def2 (cdr (assoc 14 (entget (car sel))))))
    (while (setq newpt (getpoint def2 "\nSelect new Dim Point <exit>: "))
      (setq newpt (inters def1 def2 newpt (polar newpt (+ (angle def1 def2) (/ pi 2)) 1) nil)
	    ent (car sel)
	    edata (entget ent)
	    elist (vl-remove-if
		    '(lambda (pair)
		       (member (car pair)
			       (list -1 2 5 102 310 300 330 331 340 350 360 410)))
		    edata))
      (entmod (subst (cons 14 newpt) (assoc 14 elist) edata))
      (entmakex (subst (cons 13 newpt) (assoc 13 elist) elist))))
  
  (command "_.UCS" "_P")
  (princ)
)

 

@miroslav.pristov For other potential readers you should mark the final version as the solution. 

Message 22 of 22

Anonymous
Not applicable
Does this routine work with Annotative Dimensions? When I try it, it makes all of the new dimensions from the split very small and not annotative. Hopefully I am doing something wrong. Thanks for sharing! Way cool.
0 Likes