Jump to content

Recommended Posts

Posted

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"

Posted
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)
)

Posted

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?

Posted
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

Posted (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 by bpdav1
Posted
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! :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...