Jump to content

Adding additional text to Dimension Text Override


RoguePiper

Recommended Posts

hope you don't mind lee. Look at lee's code and replace the 13th line of lee's code with

                    (subst (cons 1 (strcat s " [" (rtos n 2 3) "]\n" (rtos n 3))) (assoc 1 (entget e))

\n = new line

 

look at (rtos n 2 3)

the n after rtos is your measurement which was defined in the 7th line of lee's code see (setq n (distof s)))

see below for the number after the n and the last number is how many decimal places you want

1Scientific2Decimal3Engineering4Architectural5Fractional

Link to comment
Share on other sites

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • RoguePiper

    8

  • Lee Mac

    7

  • Tharwat

    7

  • Lt Dan's legs

    2

Top Posters In This Topic

Posted Images

Personally, in that case, I'd use a dimension Style with the Alternate Units set.

... even if it meant having to change styles programmatically you'd be in front because the dimension would retain it's associativity.

 

An alternative would be to apply dim over-rides to the specific dimensions you wanted to display with the Alternate Dimensions .. again retaining associativity.

 

Another alternative to programming a solution is to dim-override modify one dimension manually ( you'd need linear and aligned) then simply use MatchProperties to apply the settings to other dimensions

 

a piccy:

Alternate Dimensions.jpg

Link to comment
Share on other sites

The alternate units won't work in this case. The drawing is not to scale and all dimensions are put in with text overrides. I have been able to achieve the results I want with the base that Lee started me on.

Link to comment
Share on other sites

Done. Works like I want it to.

 

(defun c:ImpDim ( / ss )
 ;; © Lee Mac 2010

 (if (setq ss (ssget "_:L" '((0 . "DIMENSION"))))
   (
     (lambda ( i / e s n )
       (while (setq e (ssname ss (setq i (1+ i))))
         (if (and (setq s (cdr (assoc 1 (entget e)))) (setq n (/ (distof s) 25.4)))
           (entupd
             (cdr
               (assoc -1
                 (entmod
           (subst (cons 1 (strcat s "\\X[" (rtos n 2 3) "\"]")) (assoc 1 (entget e))
                     (entget e)
                   )
                 )
               )
             )
           )
         )
       )
     )
     -1
   )
 )

 (princ)
)

Link to comment
Share on other sites

Glad you got it working in the end mate - was working all day so couldn't get back to you sooner. The only thing I would ask is to mark where you modified with your initials or other - this is standard coding practice. :)

Link to comment
Share on other sites

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