Jump to content

Lisp to add +/- to dimension text??????


Recommended Posts

Posted (edited)

I am currenty using a lisp I found and modified that adds +/- the beginning of my dimension text. The current lisp is:

 

pm.GIF

 

Does anyone know how to modify the dimension precision to 1" inside this routine when +/- is added?

 

Thanks

Edited by asteffy
Posted

Correct, wasn't sure if this could be incorporated into a lisp?

Posted
Correct, wasn't sure if this could be incorporated into a lisp?

 

A program could be used to attach the relevant Dimension Style Override XData to selected Dimensions, but it would be far easier to simply modify your Dimension Style and click on the Dimension Update button on the Dimensions Toolbar.

Posted

It can be (see below). However, a separate dimension style might save you some headaches/work...

 

(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)))))
       1
     )
     (vla-put-TextOverride o "±<>")
   )
 )
 (princ)
)

Posted

This is very close, however, how would I modify it to nearest whole inch instad of hlaf inch?

Posted
This is very close, however, how would I modify it to nearest whole inch instad of hlaf inch?

Change the "1" for vla-put-PrimaryUnitsPrecision to "0".

Posted
Thanks for the help

No problem. As I said, a separate style *might* be less legwork.

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...