+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Forum Deity rkent's Avatar
    Computer Details
    rkent's Computer Details
    Operating System:
    WIN7 PRO 64bit
    Computer:
    Dell Precision T7500
    CPU:
    Xeon Dual Core E5503 2.0Ghz
    RAM:
    6GB DDR3 ECC SDRAM, 1333MHz, 6x1GB
    Graphics:
    nVidia Quadro 3800
    Primary Storage:
    300Gb, 10K rpm
    Monitor:
    Dell 24" FS (2x)
    Discipline
    Mechanical
    rkent's Discipline Details
    Occupation
    Facilities Design - Semi-conductor manufacturing
    Discipline
    Mechanical
    Details
    Designer: Process Piping, P&ID's, Machine Part Design, Planning / General Arrangement. Facilities Management. Drafting: Electrical, Controls, Architectural.
    Using
    Mechanical 2014
    Join Date
    Nov 2007
    Location
    Lat:35, Long:-106, Elev: 5164'
    Posts
    3,371

    Default lisp file help, add text to dim

    Registered forum members do not see this ad.

    I want to take some existing code I found over on another site and change it to add user input. I have added a getstring line but I don't know how to get the program to evaluate that later when needed. So I have a setq ndimtext line, and later I need it to use that setq string in the setq NewDimValue line. Hopefully that makes sense.

    Code:
     
    ; original code from Mike Perry, AUGI NG
    (defun c:DimAddText (/ DimObject ndimtext NewDimValue)
      (setq ndimtext (getstring "Enter text to add to dim: "))
      (princ "\nSelect Dimension to add \(REF.\) to: ")
      (setq DimObject (ssget '((0 . "DIMENSION"))))
      (if (not (eq DimObject nil))
     (progn
       (setq NewDimValue "<>\\X\( ndimtext \)")
       (command "._DimEdit" "_N" NewDimValue DimObject "")
     )
      )
      (princ)
    )
    "You are entitled to your own opinion but you are not entitled to your own facts." Daniel Patrick Moynihan

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,712

    Default

    Perhaps:

    Code:
      ; original code from Mike Perry, AUGI NG
    
    (defun c:DimAddText  (/ DimObject ndimtext NewDimValue)
      (vl-load-com)
      (setq ndimtext (getstring t "\nEnter text to add to dim: "))
      (princ "\nSelect Dimension to add \(REF.\) to: ")
      (if (setq DimObject (ssget '((0 . "DIMENSION"))))
        (foreach Obj  (mapcar 'vlax-ename->vla-object
                        (vl-remove-if 'listp
                          (mapcar 'cadr
                            (ssnamex DimObject))))
          (vla-put-TextOverride Obj (strcat "<>\\X" ndimtext)))
        (princ "\n<!> No Dimensions Selected <!>"))
      (princ))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Forum Deity rkent's Avatar
    Computer Details
    rkent's Computer Details
    Operating System:
    WIN7 PRO 64bit
    Computer:
    Dell Precision T7500
    CPU:
    Xeon Dual Core E5503 2.0Ghz
    RAM:
    6GB DDR3 ECC SDRAM, 1333MHz, 6x1GB
    Graphics:
    nVidia Quadro 3800
    Primary Storage:
    300Gb, 10K rpm
    Monitor:
    Dell 24" FS (2x)
    Discipline
    Mechanical
    rkent's Discipline Details
    Occupation
    Facilities Design - Semi-conductor manufacturing
    Discipline
    Mechanical
    Details
    Designer: Process Piping, P&ID's, Machine Part Design, Planning / General Arrangement. Facilities Management. Drafting: Electrical, Controls, Architectural.
    Using
    Mechanical 2014
    Join Date
    Nov 2007
    Location
    Lat:35, Long:-106, Elev: 5164'
    Posts
    3,371

    Default

    LeeMac,
    Thanks, that works great.
    rkent
    "You are entitled to your own opinion but you are not entitled to your own facts." Daniel Patrick Moynihan

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,712

    Default

    Registered forum members do not see this ad.

    No probs rkent - if you need anything about the code explained, just ask
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. run lisp on file
    By JONTHEPOPE in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 20th Apr 2009, 07:39 pm
  2. lisp file for rotating text
    By bsimpson in forum AutoLISP, Visual LISP & DCL
    Replies: 13
    Last Post: 16th Nov 2007, 03:13 pm
  3. Text lisp file
    By bsimpson in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 12th Oct 2007, 04:21 pm
  4. doubts in creating text file thru lisp
    By vivekgrs in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 3rd Aug 2006, 09:11 am
  5. create a text file using lisp
    By vivekgrs in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 28th Jul 2006, 01:11 am

Bookmarks

Posting Permissions

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