Results 1 to 3 of 3

Thread: Autocad Lips to copy dimension text tol clipboard

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2013-02
    Posts
    1
    Login to Give a bone
    0

    Default Autocad Lips to copy dimension text tol clipboard

    Hi I need a lisp that can copy dimension text to clip board

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Autocad Lips to copy dimension text tol clipboard

    Hi ,

    Hope this would help you with your aim of the code .

    Code:
    (defun c:Test (/ *error* l ss st vl e gr p)
      (vl-load-com)
    ;;; Tharwat 11. Feb. 2013 ;;;
      (defun *error* (x)
        (if e
          (entdel e)
        )
        (princ "*Cancel*")
      )
      (if
        (and
          (setq l
                 (not
                   (eq 4
                       (logand
                         4
                         (cdr
                           (assoc 70
                                  (entget (tblobjname "LAYER" (getvar 'clayer)))
                           )
                         )
                       )
                   )
                 )
          )
          (progn (print "Select Dimension...")
                 (setq ss (ssget "_+.:S" '((0 . "*DIMENSION"))))
          )
        )
         (progn
           (setq st (vla-get-measurement
                      (setq vl (vlax-ename->vla-object (ssname ss 0)))
                    )
           )
           (setq
             e (entmakex (list '(0 . "TEXT")
                               (cons 10 (setq p (cadr (grread t 15 0))))
                               (cons 11 p)
                               (cons 1 (rtos st 2))
                               (cons 8 (vla-get-layer vl))
                               (cons 40 (vla-get-textheight vl))
                         )
               )
           )
           (while (eq (car (setq gr (grread t 15 0))) 5)
             (redraw)
             (entmod
               (subst (cons 10 (cadr gr)) (assoc 10 (entget e)) (entget e))
             )
           )
         )
         (cond ((not l) (princ "\n Current layer is locked !!"))
               (t (princ "\n Nothing selected or not a dimension !!"))
         )
      )
      (princ "\n Written by Tharwat Al Shoufi")
      (princ)
    )

  3. #3
    All AUGI, all the time
    Join Date
    2010-10
    Posts
    535
    Login to Give a bone
    0

    Default Re: Autocad Lips to copy dimension text tol clipboard

    Code:
    (Defun c:Dim2Clip  (/ ss st 2ClipB)
      (vl-load-com)
     (print "Select Dimension...")
             (if (setq ss (ssget "_+.:S" '((0 . "*DIMENSION"))))
               (progn (setq st (vla-get-measurement (setq vl (vlax-ename->vla-object (ssname ss 0)))))
                      (vlax-invoke
                                     (vlax-get (vlax-get (setq 2ClipB (vlax-create-object "htmlfile")) 'ParentWindow)
                                               'ClipBoardData)
                                     'SetData
                                     "Text"
                                     (rtos st))
                      (vlax-release-object 2ClipB)))
        )

Similar Threads

  1. copy to clipboard
    By johnf.77896 in forum Revit Architecture - General
    Replies: 3
    Last Post: 2009-07-31, 02:51 PM
  2. Can't Copy to clipboard
    By johnbillman in forum AutoCAD General
    Replies: 5
    Last Post: 2008-03-30, 10:44 PM
  3. Copy to Clipboard
    By d.stairmand in forum Revit Architecture - General
    Replies: 1
    Last Post: 2008-02-13, 12:33 AM
  4. copy dwg name to clipboard
    By Grayham in forum AutoCAD Customization
    Replies: 19
    Last Post: 2007-09-12, 07:37 AM
  5. Viewport will not copy to clipboard
    By ssolberg in forum AutoCAD General
    Replies: 17
    Last Post: 2006-11-15, 03:16 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
  •