Tuns Posted August 2, 2013 Posted August 2, 2013 Well simply put, I have a macro with the -text command in it. The problem is in one of my drawings it asks for the text height while in the other it does not. It's bugging me that I can't use my macro in both places without having to change it a little. Would anyone know why it's doing this? Quote
Tyke Posted August 2, 2013 Posted August 2, 2013 If you go to the text style format window you will see a height box where the default text height is defined. If the text height is defined as 0.0 then you will be prompted to enter the text height to be used, but if a text height is defined that value will be used when the text is inserted. Try inserting in your macro, before the text insertion command the System Variable "TEXTSIZE;0.4" to have a text size of 0.4 drawing units. Obviously without the quotation marks and with the size you want. Quote
Tuns Posted August 2, 2013 Author Posted August 2, 2013 So something like ^C^Ctextsize;4";-text;.... would work? Quote
Tyke Posted August 2, 2013 Posted August 2, 2013 So something like ^C^Ctextsize;4";-text;.... would work? Yes that should work without the inches ie. ^C^Ctextsize;4;-text;.... Quote
Tuns Posted August 2, 2013 Author Posted August 2, 2013 Alright thanks Tyke. Love you no homo. It works with the inches as well I just put that there out of habit because when I make my macros I want it to be easy to distinguish feet from inches. Quote
Tyke Posted August 2, 2013 Posted August 2, 2013 No problems, I'm glad to help any time and thanks for coming back to say it worked for you, it could be help later when someone else does a search and can see it works. Quote
Tuns Posted August 2, 2013 Author Posted August 2, 2013 I just did what you said and it still asks for a text height... This is wacked. This is what I did before your suggestion to make it work: ^C^Czoom;all;-text;1',-1';[color="red"]4"[/color];0;LAST EDITED BY IAN ON:($M=$(EDTIME,0,MON DD"," YYYY H:MM AM/PM));save;close; The problem here though most of my drawings I don't need that 4" there so it doesn't work the way it should work. The idea you came up with seemed like it would work but it still asks for text height. This is your version tyke: ^C^Czoom;all;textsize;4";-text;1',-1';0;LAST EDITED BY IAN ON:($M=$(EDTIME,0,MON DD"," YYYY H:MM AM/PM));save;close; Quote
Tyke Posted August 2, 2013 Posted August 2, 2013 I'm not on my CAD computer at the moment so I can't test anything, but look at Ralph Grabowski's tutorials on DIESEL macros and create an if expression which looks for a value in TEXTSIZE, if it finds a value of 0.0 then assign your 4" height. Here's the link http://www.upfrontezine.com/tailor/tailor17.htm Sorry I can't be more help at the moment, but I hope you can utilise a DIESEL expression to overcome the problem. Quote
Tuns Posted August 2, 2013 Author Posted August 2, 2013 (edited) Well then... I'm completely stumped... I read the command line and changed the macro to what I thought would work which was this: ^C^Czoom;all;-text;1',-1';0;LAST EDITED BY IAN ON:($M=$(EDTIME,0,MON DD"," YYYY H:MM AM/PM));save;close; because the command line read like so: Command: zoom Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: all Command: -text [color="red"]Current text style: "TECHNIC" Text height: 0'-4" Annotative: No Justify: Left[/color] Specify start point of text or [Justify/Style]: 1',-1' Specify height <0'-4">: 0 Value must be positive and nonzero. Notice the line in red... Why is it set to a text height of 0'-4" by default yet its asking me to specify a height? This makes no sense whatsoever...Also I made one with a diesel function that checked if the value was 0 and if it came back true it would set it at 4" and I got the same result... it still asked for a text height... it's weird though it will only go wrong on this one layout. If you need to see it I can email it to you. It's too big of a file to post here. Edited August 2, 2013 by Tuns Quote
Lee Mac Posted August 3, 2013 Posted August 3, 2013 Why is it set to a text height of 0'-4" by default yet its asking me to specify a height? Because the Text Style height is set to zero. Changing the value of the TEXTSIZE system variable will only alter the default text height, the Text command will always prompt for a text height if the Text Style height is set to zero. Unfortunately, I don't think there is a system variable which references the text height of the active Text Style (Note that the TEXTSIZE system variable is purely the stored default height & bears no relation to the text height of the active Text Style). In LISP, this would be a simple conditional: (if (zerop (cdr (assoc 40 (tblsearch "style" (getvar 'textstyle))))) ... ) However, seeing that you are using LT AutoLISP is out of the question. Quote
Tuns Posted August 5, 2013 Author Posted August 5, 2013 (edited) Ah I gotchya Lee, thanks. Thanks to you I found a solution: ^C^Czoom;all;[color="red"]-style;technic;technic_.ttf;3.5";;;;;[/color]-text;1',-1';0;LAST EDITED BY IAN ON:($M=$(EDTIME,0,MON DD"," YYYY H:MM AM/PM));save;close; Edited August 5, 2013 by Tuns Quote
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.