Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to divide dimension line in points

21 REPLIES 21
SOLVED
Reply
Message 1 of 22
miroslav.pristov
4244 Views, 21 Replies

How to divide dimension line in points

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

21 REPLIES 21
Message 21 of 22
ВeekeeCZ
in reply to: Kent1Cooper


@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
in reply to: ВeekeeCZ

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta