Tharwat Posted August 10, 2010 Share Posted August 10, 2010 Hi, I wonder how to get the Text Style height as long as the (getvar 'textsize) is different than that. (entmakex (list (cons 0 "TEXT") (cons 10 pt) (cons 40 ([color="red"]text style height[/color])) (cons 1 strings))) Thanks Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 10, 2010 Share Posted August 10, 2010 Would you please ask the question again, stating exactly what you want. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2010 Author Share Posted August 10, 2010 Thanks Kerry, I would like to get the current text height that included within my text style list . Regards, Tharwat Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2010 Author Share Posted August 10, 2010 May be with a photo is much clearer .. Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 10, 2010 Share Posted August 10, 2010 current textheight is (getvar "TEXTSIZE") but, it will depend on the last style used. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2010 Author Share Posted August 10, 2010 You know , the problem is that when modifying the Height of Text Style, it's not going to be changed in (getvar 'textsize) as well. So sometimes I change the Height of Text Style to 200 and the (getvar 'textsize) is kept as 0.2 , and when it's used in Lisp that would be so small. and if I depend on the Text Style, it could disappointed if it is 0.00 . Any idea ? Thanks, Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 10, 2010 Share Posted August 10, 2010 In the textStyle definition look at DXF 40 Fixed text height; 0 if not fixed DXF 42 Last height used Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2010 Author Share Posted August 10, 2010 That's right if I select an entity and get the text height of it. This would be disappointing if the drawing texts' heights are 200. Because the System Variable do not change unless somebody do. (entmakex (list (cons 0 "TEXT") (cons 10 pt) (cons 40 (getvar 'textsize)) (cons 1 strings))) This would be also disappointed if the texts' heights are 0.2. (entmakex (list (cons 0 "TEXT") (cons 10 pt) (cons 40 200) (cons 1 strings))) That's why I wonder which text height I have to keep in my daily Lisp specially when drawing are in different scales ! Regards Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 10, 2010 Share Posted August 10, 2010 Personally I'd use this. (setq ots (vla-get-activetextstyle (vla-get-activedocument (vlax-get-acad-object)) ) CurrentHeight (vla-get-height ots) LastHeight (vla-get-lastheight ots) ) but make sure you understand it before using it. A little trial and error and reading should fix that. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2010 Author Share Posted August 10, 2010 Thanks Kerry, That must be professional way that I should gather all my strengths to get it understood. And what I got right now in a hint, is that codes would get the height of last object in a drawing has been created, so depending on that object height , the running Lisp would implement in the current drawing. Is that right? Beside that, also you have current text height would be considered as well. I think the error that you indicated to is that in a new drawing when there is no texts heights implemented yet ...... Hope that be right? Thank you once again Kerry, Tharwat Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 10, 2010 Share Posted August 10, 2010 Try it !!! Open a new drawing and run my code Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2010 Author Share Posted August 10, 2010 Did I get it well ? Please tell me. Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 10, 2010 Share Posted August 10, 2010 Did I get it well ? Please tell me. Did you get what ?? Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 10, 2010 Share Posted August 10, 2010 I just tried this in a new drawing The result was as expected. (vl-load-com) (setq ots (vla-get-activetextstyle (vla-get-activedocument (vlax-get-acad-object)) ) CurrentHeight (vla-get-height ots) LastHeight (vla-get-lastheight ots) ) (alert (strcat "TEXTSTYLE : " (getvar 'TEXTSTYLE) "\n TEXTSIZE : " (vl-prin1-to-string (getvar 'TEXTSIZE)) "\n CurrentHeight : " (vl-prin1-to-string CurrentHeight) "\n LastHeight : " (vl-prin1-to-string LastHeight) ) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2010 Author Share Posted August 10, 2010 Kerry, You are GREAT. I feel speachless. You are doing a very special kind of lisp techniqe . Best regards, Tharwat 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.