+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18
  1. #11
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    582

    Default

    Registered forum members do not see this ad.

    When i run the same lisp in the drawing gives me any time other paper space. Tha paper space must be 2.5 all the times. My annotatine scale settings is correct.All the problem is in my code , and i dont know fix it

  2. #12
    Senior Member
    Computer Details
    OMEGA-ThundeR's Computer Details
    Operating System:
    Windows 10
    Computer:
    HP Z440
    Discipline
    Civil
    OMEGA-ThundeR's Discipline Details
    Occupation
    Civil Engineer (CAD Design)
    Discipline
    Civil
    Using
    AutoCAD 2017
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    254

    Default

    Can you write out the things you would do manually to achieve the correct settings?

    Something like;

    - Run TEXT command
    - Place text (and give it x.x height and what other settings)
    - Go to properties
    - Change to annotative
    - Set up the right scales
    - etc

  3. #13
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    582

    Default

    Code:
    (defun c:txt2 (/ *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 0.0125) 
                   (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
    When i have the scale to 1:1 and run the code works for all scales.
    When i change the scale to 1:200 or 1:500 etc and run again the code , all the results are wrong. i want to give the same results with all scales

  4. #14
    Senior Member
    Computer Details
    OMEGA-ThundeR's Computer Details
    Operating System:
    Windows 10
    Computer:
    HP Z440
    Discipline
    Civil
    OMEGA-ThundeR's Discipline Details
    Occupation
    Civil Engineer (CAD Design)
    Discipline
    Civil
    Using
    AutoCAD 2017
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    254

    Default

    As far as i can tell there is nothing wrong with the lisp routine. The text is 2.5 high.

    You need to add the right scales to the SCALELISTEDIT list.
    Then you need to add the right scales (you might have more) to the text you want to show in the viewport.
    To set the right scales select the text, go to the properties window and click the smal icon to the right when selecting 'Annotative Scales' (standard 1:1?). Add the scales you want.
    Then in paperspace you create a viewport and select that viewport border and set it to the right Annotative scale in the properties window. This is not the same as the viewport scale! (standard scale in properties window).

    If you set the SCALELISTEDIT right and set the right scales to the text and viewport it should work. This thread makes me learn more and more about annotative scales but it works perfect on my end.

  5. #15
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    582

    Default

    Now is working
    Code:
    (defun c:txt2 (/ *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
      (command "_.-text" "_justify" "_bl" pt1 "" tval)
        ) ;_  end while
        (*error* "")
        (princ)
    ) ;_  end defun

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

    Default

    I found an angle rottation error in the code # 15. Can any one help ?

    In the beginnig the code was

    Code:
    (entmake (list '(0 . "TEXT")
                   '(8 . "TEXT")
                   (cons 10 pt1)
                  (cons 40 0.0125) 
                   (cons 1 tval)
                   '(50 . 0.0)
                   '(7 . "_KEIM") 
                   '(71 . 0)
                   '(72 . 0)
                   '(73 . 0)
             ) ;_  end list
        ) ;_  end entmake

  7. #17
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    8,918

    Default

    Was angle 90 degrees out, you set it to 0.0 may be need to set the direction and radians from units, these are variables you can set, may be these (SETVAR "LUNITS" 2) (SETVAR "ANGDIR" 0)
    A man who never made mistakes never made anything

  8. #18
    Super Member prodromosm's Avatar
    Using
    AutoCAD 2014
    Join Date
    Jul 2010
    Posts
    582

    Default

    Registered forum members do not see this ad.

    I am using grads, clockwise , direction north

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