Check these system variables:
PICKFIRST should be 1
DBLCLKEDIT should be on
noun/verb selection should be on
Check your UI behavior, default double-click should be, well, whatever you were doing, instead of TEXTEDIT.
If that doesn't help, please provide more information.
Welcome to the forum!
@Engineer_Yasser updated your code to work with polylines longer then one segment. Then I noticed depending on the zoom some dims might not be created. particularity the 7.40 and 14.52 . updating to visual lisp and not using command fixes this issue and should make it run faster.
(defun c:test (/ sel myent bulg i p1 p2 mid a r c)
(vl-load-com)
(vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object))))
(setq mspace (vla-get-ModelSpace doc)) ;forgot this line
(if (setq sel (ssget '((-4 . "<AND") (0 . "*POLYLINE") (-4 . "<>") (42 . 0.0) (-4 . "AND>"))))
(foreach MyEnt (vl-remove-if 'listp (mapcar 'cadr (ssnamex sel)))
(setq bulg (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 42)) (entget MyEnt))))
(if (/= (cdr (assoc 70 (entget MyEnt))) 1)
(vl-remove (last bulg) bulg)
)
(setq i 0)
(foreach seg bulg
(if (and (/= seg 0.0)
(setq p1 (vlax-Curve-GetPointAtParam MyEnt i)
mid (vlax-Curve-GetPointAtParam MyEnt (+ i 0.5))
p2 (vlax-Curve-GetPointAtParam MyEnt (+ i 1))
)
)
(progn ;pulled from here http://www.lee-mac.com/bulgeconversion.html#bulgearc
(setq a (* 2 (atan seg))
r (/ (distance p1 p2) 2 (sin a))
c (polar p1 (+ (- (/ pi 2) a) (angle p1 p2)) r)
)
(vla-AddDimArc mspace (vlax-3d-point c) (vlax-3d-point p1) (vlax-3d-point p2) (vlax-3d-point mid))
;(Command "_.DIMARC" MyEnt "_non" mid "_non" mid)
)
)
(setq i (1+ i))
)
)
)
(vla-EndUndoMark doc) ;and this line
(princ)
)
Quickly written, but should do the job -
(defun c:test ( / d )
(vlax-for b (vla-get-blocks (setq d (vla-get-activedocument (vlax-get-acad-object))))
(if (= :vlax-false (vla-get-isxref b) (vla-get-islayout b))
(vlax-for o b
(if (and (= "AcDbCircle" (vla-get-objectname o)) (equal 0.0 (vla-get-radius o) 1e-8) (vlax-write-enabled-p o))
(vla-put-radius o 1.0)
)
)
)
)
(vla-regen d acallviewports)
(princ)
)
(vl-load-com) (princ)