Message 1 of 5
Not applicable
08-20-2019
11:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got the following bit of code and I can't seem to figure out why it won't create the dimension object.
(defun C:DIMDIA (/ pr cl osm obj rad ep sp ss count newdim d ) (setvar "cmdecho" 0) ;Variables (setq pr (getvar "luprec")) (setq cl (getvar "clayer")) (setq osm (getvar "osmode")) (setvar "osmode" 0) (if (= (getvar "lunits") 2) (setvar "luprec" 3)) (setq obj (vlax-ename->vla-object (setq e (car (entsel "\nSelect circle to Dimension: "))))) (if (= (vla-get-objectname obj) "AcDbCircle") (progn (setq rad (vla-get-radius obj))
(setq f (getpoint "\nLeader Location: ")) (command "LAYER" "M" "DIM" "") (command "AMPOWERDIM_DIA" e f ) (princ "\nSelect Circles for hole count") (setq ss (ssget (list '(0 . "CIRCLE")(cons 40 rad)))) (if (/= (setq count (sslength ss)) 0) (progn (setq newdim (entlast)) (setq d (strcat "<>" "[]" " (" (itoa count) " PLACES)")) (command "dimedit" "n" d newdim "") ) ) ) (princ "\nSelected Object is not a circle.") ) (setvar "clayer" cl) (setvar "luprec" pr) (setvar "osmode" osm) (princ) )
It seems to completely skip over the (command "AMPOWERDIM_DIA" e f ) portion of code, while the rest of it executes flawlessly, instead altering the previously placed dimension.
Also, would there be a way to show the preview of the dimension location before its placed? I tried nesting the (getpoint) within the "AMPOWERDIM_DIA" command, but no such luck, though that might be tied to the first issue.
Solved! Go to Solution.