MajorTom Posted November 15, 2019 Share Posted November 15, 2019 When I use the text command in Autolisp, my current dwg works well, but when I try a different dwg (which is a drawing in a previously worked dwg.), I think it wants the "width" input. how can I solve this situation. Thanks in advance Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 15, 2019 Share Posted November 15, 2019 Try to use entmake function instead of command call as follows: (defun CreateText (pt hgt str) (entmake (list '(0 . "TEXT") (cons 10 pt) (cons 40 hgt) (cons 1 str))) ) 1 Quote Link to comment Share on other sites More sharing options...
tombu Posted November 15, 2019 Share Posted November 15, 2019 4 hours ago, MajorTom said: When I use the text command in Autolisp, my current dwg works well, but when I try a different dwg (which is a drawing in a previously worked dwg.), I think it wants the "width" input. how can I solve this situation. Thanks in advance Sounds like the Justification is set to Fit, it's saved in each drawing. TEXTJUSTIFY (System Variable) https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Core/files/GUID-223C6FB9-B498-4BA9-8710-E1CB4889B8FC-htm.html 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 16, 2019 Share Posted November 16, 2019 Sounds like the Text styles are different even though same name. Obvious is height example 0.0 or 2.5 1 Quote Link to comment Share on other sites More sharing options...
MajorTom Posted November 18, 2019 Author Share Posted November 18, 2019 I hope this video can help to me for explain the problem textero.mp4 Quote Link to comment Share on other sites More sharing options...
tombu Posted November 18, 2019 Share Posted November 18, 2019 Not really, can you post a translation of the command prompt that you think wants the "width" input? If the DTEXT Justification is set to Fit the command prompt would be "Specify first endpoint of text baseline:" 1 Quote Link to comment Share on other sites More sharing options...
MajorTom Posted November 18, 2019 Author Share Posted November 18, 2019 (edited) 2 hours ago, tombu said: Not really, can you post a translation of the command prompt that you think wants the "width" input? If the DTEXT Justification is set to Fit the command prompt would be "Specify first endpoint of text baseline:" in this case what I have to add to my lisp routine. Edited November 18, 2019 by MajorTom Quote Link to comment Share on other sites More sharing options...
tombu Posted November 18, 2019 Share Posted November 18, 2019 5 minutes ago, MajorTom said: in this case what I have to add to my lisp routine. LEVHAYAP.lsp 3.6 kB · 0 downloads (setvar 'TEXTJUSTIFY "Left") will set DTEXT Justification to the default "Left". 1 Quote Link to comment Share on other sites More sharing options...
MajorTom Posted November 18, 2019 Author Share Posted November 18, 2019 1 hour ago, tombu said: (setvar 'TEXTJUSTIFY "Left") will set DTEXT Justification to the default "Left". Woudn't worked I think it's about anotation text style or something like that but really I don't know how I get over this situation Quote Link to comment Share on other sites More sharing options...
tombu Posted November 18, 2019 Share Posted November 18, 2019 (edited) 33 minutes ago, MajorTom said: Wouldn't worked I think it's about annotation text style or something like that but really I don't know how I get over this situation Again can you post an english translation of the command prompt that you think wants the "width" input? No other way to figure out what's happening. Annotative text wouldn't ever need "Height" entered, if your code included Height in the Text command call that would cause an issue. It would have the same issue with any Text Style that had a Height not set to 0. Test the Height of the current text style in your code with: (cdr (assoc 40 (tblsearch "style" (getvar "textstyle")))) If include Height or don't include Height Edited November 18, 2019 by tombu 1 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.