好吧,我基本上都明白了。最后只需要一个摄政王。我希望在放置每个continue维度后重新生成,但我现在会接受它,直到我有几天以上的自动/视觉lisp经验为止
- (defun c:cdim (/ pt1 pt2 doc )
- ;This function allows the user to dimension continuously and then after they are done insert the overall distance
- (vl-load-com);load visual lisp
- (setq doc (vla-get-ActiveDocument(vlax-get-acad-object)))
- (vla-put-ActiveUCS doc(vla-add (vla-get-usercoordinatesystems doc) (vlax-3D-point '(0. 0. 0.)) (vlax-3D-point '(1. 0. 0.))
- (vlax-3D-point '(0. 1. 0.)) "TempWorld_UCS"))
- (command "_UCS" "NA" "r" "TempWorld_UCS")
- ;change the UCS to world so the final dimension will insert correctly
- (command "dimlinear" pause pause pause);start the first dimension
- (setq pt1 (cdr (assoc 13(entget (entlast)))));get the start point
- (command "dimcontinue");dimension everything in between start and end
- (while (/= (getvar "CMDACTIVE") 0);keep the dimcontinue going until user exits
- (command pause)
- (vlax-put (vlax-ename->vla-object (setq obj (entlast))) 'textmovement 0)
- )
- (command "regen")
- (setq pt2 (cdr (assoc 14(entget (entlast)))));get end point from last dimcontinue inserted
- (command "dimlinear" pt1 pt2 pause);place the overall dimension
-
- )
|