Guest Posted January 11, 2017 Share Posted January 11, 2017 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 ??? (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 Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2017 Share Posted January 11, 2017 I dont know why the annotate is not working Quote Link to comment Share on other sites More sharing options...
OMEGA-ThundeR Posted January 11, 2017 Share Posted January 11, 2017 It's a crude solution, but it worked for me ) ;_ 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. Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2017 Share Posted January 11, 2017 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? (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 Quote Link to comment Share on other sites More sharing options...
OMEGA-ThundeR Posted January 11, 2017 Share Posted January 11, 2017 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 . Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2017 Share Posted January 11, 2017 I told to the code that (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 Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2017 Share Posted January 11, 2017 Thanks i find it Quote Link to comment Share on other sites More sharing options...
OMEGA-ThundeR Posted January 11, 2017 Share Posted January 11, 2017 If there is any field of expertise i lack it's annotative scales. So i can't be of help on that field . Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2017 Share Posted January 11, 2017 Is still not working properly. This is not the correct way to do this ... ) ;_ end entmake (command "CHPROP" "last" "" "Annotative" "yes" "") ) ;_ Quote Link to comment Share on other sites More sharing options...
OMEGA-ThundeR Posted January 11, 2017 Share Posted January 11, 2017 Why not? It does what was asked right? Set the text object annotative? What is the problem? You need to change something else too? Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2017 Share Posted January 11, 2017 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 Quote Link to comment Share on other sites More sharing options...
OMEGA-ThundeR Posted January 11, 2017 Share Posted January 11, 2017 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 Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2017 Share Posted January 11, 2017 (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 Quote Link to comment Share on other sites More sharing options...
OMEGA-ThundeR Posted January 11, 2017 Share Posted January 11, 2017 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. Quote Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2017 Share Posted January 11, 2017 Now is working (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 Quote Link to comment Share on other sites More sharing options...
Guest Posted January 21, 2017 Share Posted January 21, 2017 I found an angle rottation error in the code # 15. Can any one help ? In the beginnig the code was (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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 21, 2017 Share Posted January 21, 2017 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) Quote Link to comment Share on other sites More sharing options...
Guest Posted January 25, 2017 Share Posted January 25, 2017 I am using grads, clockwise , direction north Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.