Results 1 to 4 of 4

Thread: input a number then put in dimension text

  1. #1
    Member
    Join Date
    2015-09
    Posts
    4
    Login to Give a bone
    0

    Default input a number then put in dimension text

    hi everyone,
    I want to find a program for my work faster
    So I google and come up with this but it did not work
    please any one give me some hint

    (Defun c:balls ()
    (setq a (getint "\nEnter the number of balls:"))
    (setq newdim (entsel "\n Select Dimension to annotation:"))
    (setq newdimvalue "a @270 CTS= <>")
    (command "dimedit" "n" newdimvalue newdim "")
    (princ)
    )

    thanks very much

  2. #2
    I could stop if I wanted to
    Join Date
    2009-03
    Location
    London, England
    Posts
    304
    Login to Give a bone
    0

    Default Re: input a number then put in dimension text

    You will need to use strcat to concatenate the value of the variable 'a' converted to a string, with the rest of the string.

    i.e.
    Code:
    (strcat (itoa a) " @270 CTS= <>")

  3. #3
    I could stop if I wanted to
    Join Date
    2009-03
    Location
    London, England
    Posts
    304
    Login to Give a bone
    0

    Default Re: input a number then put in dimension text

    This might be another way to approach it, rather than using the dimedit command:

    Code:
    (defun c:balls ( / a d )
    
      (initget 6)
      (setq a (itoa (cond ((getint "\nEnter the Number of Balls <1>: ")) ( 1 ))))
    
      (while
        (progn (setvar 'ERRNO 0) (setq d (car (entsel "\nSelect Dimension: ")))
          (cond
            ( (= 7 (getvar 'ERRNO))
              (princ "\n--> Missed, Try Again.")
            )
            ( (eq 'ENAME (type d))
              (if (wcmatch (cdr (assoc 0 (setq d (entget d)))) "*DIMENSION")
                (entmod (subst (cons 1 (strcat a " @270 CTS= <>")) (assoc 1 d) d))
                (princ "\n--> Invalid Object Selected.")
              )
            )
          )
        )
      )
      (princ)
    )

  4. #4
    Member
    Join Date
    2015-09
    Posts
    4
    Login to Give a bone
    0

    Default Re: input a number then put in dimension text

    thanks you very much

Similar Threads

  1. 2013: Input a new dimension type without changing existing dimensions
    By sdg812434025 in forum AutoCAD General
    Replies: 3
    Last Post: 2013-10-27, 03:16 PM
  2. Running Object Snap Lost During Dimension Input
    By cadjockey in forum AutoCAD General
    Replies: 0
    Last Post: 2012-11-29, 01:16 PM
  3. Help?! Fully Parametric Cupboard base on input length and number of CBD required?
    By Richard McCarthy in forum Revit Architecture - General
    Replies: 9
    Last Post: 2008-09-12, 04:37 PM
  4. Dimension input?
    By shaunamorain in forum Revit Architecture - General
    Replies: 6
    Last Post: 2006-09-20, 10:15 PM
  5. Dimension Input
    By scwegner in forum AutoCAD General
    Replies: 2
    Last Post: 2005-08-18, 02:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •