bpdav1 Posted August 14, 2012 Posted August 14, 2012 Is there a way to give a dim suffix to a dimension in autolisp? ie. I create two dimensions for a line, one centre to centre, with the dim suffix " C/C", the other overall, dim suffix " O/ALL" Quote
nod684 Posted August 14, 2012 Posted August 14, 2012 Is there a way to give a dim suffix to a dimension in autolisp? ie. I create two dimensions for a line, one centre to centre, with the dim suffix " C/C", the other overall, dim suffix " O/ALL" try this.. (defun c:test (/ ss i o) (vl-load-com) (if (setq ss (ssget '((0 . "*DIMENSION")))) (repeat (setq i (sslength ss)) (vla-put-PrimaryUnitsPrecision (setq o (vlax-ename->vla-object (ssname ss (setq i (1- i))))) 0 ) (vla-put-TextOverride o "<> c/c") ) ) (princ) ) or this : (defun C:Test2() (setq newdim (entsel "\nSelect Dimension on where to put C/C Symbol:")) (setq newdimvalue "<> C/C") (command "dimedit" "n" newdimvalue newdim "") (princ) ) Quote
bpdav1 Posted August 14, 2012 Author Posted August 14, 2012 Cheers, that works fantasically! Is there a way to input the coordinates or select the dimension automatically, so it doesn't ask the user to select a dimension? Quote
nod684 Posted August 14, 2012 Posted August 14, 2012 Cheers, that works fantasically! Is there a way to input the coordinates or select the dimension automatically, so it doesn't ask the user to select a dimension? If you want to apply it to all Dimension, you can just modify your Dimension Style Go to Primary Units and under Suffix enter C/C Quote
bpdav1 Posted August 14, 2012 Author Posted August 14, 2012 (edited) That's true too, thanks I also figured out I could do this: (command "dimedit" "n" "<> C/C" dimpoint "") Where dimpoint equals a known point "x,y" that touches the dimension. That cuts out the need for the entsel command and the need for the user to select a dimension. Edited August 15, 2012 by bpdav1 Quote
nod684 Posted August 14, 2012 Posted August 14, 2012 That's true too, thanks I also figured out I could do this: (command "dimedit" "n" " C/C" dimpoint "") Where dimpoint equals a known point "x,y" that touches the dimension. That cuts out the need for the entsel command and the need for the user to select a dimension. that was nice! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.