+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    568

    Default Help with a lisp

    Registered forum members do not see this ad.

    Hi , I am using this lisp a lot of time. I am trying to change the insert text to annotated. The lisp create the annotate text style . The insert text is in the correct text style but is not annotated . Can any one help ???

    Code:
    (defun c:tEST (/ *error* varlist oldvars pt1 tval)
    (command "_.-style" "_KEIM" "arial.ttf" "_annotative" "_yes" "_no" 2.5 1.0 0.0 "_no" "_no" "_no")
        (defun *error* (msg)
        (mapcar 'setvar varlist oldvars)
        (if (= msg "")
            (princ "\nText Inserted.")
            (princ "\nEsc or Error Pressed...")
        ) ;_  end if
        (princ)
        ) ;_  end defun
        (setq varlist (list "CMDECHO" "CLAYER")
          oldvars (mapcar 'getvar varlist)
        ) ;_  end setq
        (while (and    (/= (setq pt1 (getpoint "\nSelect Insertion Point: ")) nil)
            (/= (setq tval (getstring t "\nSpecify Text: ")) "")
           ) ;_  end and
        (if (not (tblsearch "Layer" "TEXT"))
            (command "-layer" "m" "TEXT" "")
        ) ;_  end if
        (entmake (list '(0 . "TEXT")
                   '(8 . "TEXT")
                   (cons 10 pt1)
                  (cons 40 (getvar "TEXTSIZE")) 
                   (cons 1 tval)
                   '(50 . 0.0)
                   '(7 . "_KEIM") 
                   '(71 . 0)
                   '(72 . 0)
                   '(73 . 0)
             ) ;_  end list
        ) ;_  end entmake
        ) ;_  end while
        (*error* "")
        (princ)
    ) ;_  end defun

  2. #2
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    568

    Default

    I dont know why the annotate is not working

  3. #3
    Senior Member
    Using
    AutoCAD 2017
    Join Date
    Oct 2008
    Posts
    229

    Default

    It's a crude solution, but it worked for me

    Code:
        ) ;_  end entmake
    (command "CHPROP" "last" "" "Annotative" "yes" "")
        ) ;_  end while
    Place that command line part in your code between the 'End entmake' en 'end while' and it should work.

    The command changes the properties of the last object, and since in this case it's a text you can change the annotative setting.

  4. #4
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    568

    Default

    Hi OMEGA-ThundeR , thank you for the replay. I did the change and worked ,but i want the paper height to be 2.5 no t 2500 ? Any ideas?

    Code:
    (defun c:tEST (/ *error* varlist oldvars pt1 tval)
    (command "_.-style" "_KEIM" "arial.ttf" "_annotative" "_yes" "_no" 2.5 1.0 0.0 "_no" "_no" "_no")
        (defun *error* (msg)
        (mapcar 'setvar varlist oldvars)
        (if (= msg "")
            (princ "\nText Inserted.")
            (princ "\nEsc or Error Pressed...")
        ) ;_  end if
        (princ)
        ) ;_  end defun
        (setq varlist (list "CMDECHO" "CLAYER")
          oldvars (mapcar 'getvar varlist)
        ) ;_  end setq
        (while (and    (/= (setq pt1 (getpoint "\nSelect Insertion Point: ")) nil)
            (/= (setq tval (getstring t "\nSpecify Text: ")) "")
           ) ;_  end and
        (if (not (tblsearch "Layer" "TEXT"))
            (command "-layer" "m" "TEXT" "")
        ) ;_  end if
        (entmake (list '(0 . "TEXT")
                   '(8 . "TEXT")
                   (cons 10 pt1)
                  (cons 40 (getvar "TEXTSIZE")) 
                   (cons 1 tval)
                   '(50 . 0.0)
                   '(7 . "_KEIM") 
                   '(71 . 0)
                   '(72 . 0)
                   '(73 . 0)
             ) ;_  end list
        ) ;_  end entmake
    (command "CHPROP" "last" "" "Annotative" "yes" "")
        ) ;_  end while
        (*error* "")
        (princ)
    ) ;_  end defun

  5. #5
    Senior Member
    Using
    AutoCAD 2017
    Join Date
    Oct 2008
    Posts
    229

    Default

    I'm sorry, but can't help you with any 'annotative' based problems. I never use annotative texts.

    You might need to edit some settings within your SCALELISTEDIT though. Or perhaps you need to change the text height in the above code from 2.5 to 0.0025.
    Anyway, there seems to be a factor 1000 problem somewhere .

  6. #6
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    568

    Default

    I told to the code that

    Code:
    (command "_.-style" "_KEIM" "arial.ttf" "_annotative" "_yes" "_no" 2.5 1.0 0.0 "_no" "_no" "_no")
    so the paper space must be 2.5

    I can not understand

  7. #7
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    568

    Default

    Thanks i find it

  8. #8
    Senior Member
    Using
    AutoCAD 2017
    Join Date
    Oct 2008
    Posts
    229

    Default

    If there is any field of expertise i lack it's annotative scales. So i can't be of help on that field .

  9. #9
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    568

    Default

    Is still not working properly.

    This is not the correct way to do this ...
    Code:
        ) ;_  end entmake
    (command "CHPROP" "last" "" "Annotative" "yes" "")
        ) ;_

  10. #10
    Senior Member
    Using
    AutoCAD 2017
    Join Date
    Oct 2008
    Posts
    229

    Default

    Registered forum members do not see this ad.

    Why not? It does what was asked right? Set the text object annotative?

    What is the problem? You need to change something else too?

Similar Threads

  1. Pause a lisp to interact with a dynamic block and then resume the lisp
    By woodman78 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 29th May 2015, 10:38 am
  2. [LISP] First time writing LISP routine... trying to rotate, move and scale
    By chiimayred in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 18th Jul 2013, 06:02 pm
  3. chk my new lisp & suggestion how to improve this lisp (intersecation cleane)
    By autolisp in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 1st Sep 2010, 03:55 am
  4. Replies: 3
    Last Post: 10th Aug 2010, 04:39 am
  5. a lisp to apply 3 different lisp to 3 obj types filtered from one selection
    By gilsoto13 in forum AutoLISP, Visual LISP & DCL
    Replies: 28
    Last Post: 5th Nov 2009, 05:28 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