yrnomad Posted August 19, 2009 Share Posted August 19, 2009 I remember maybe 5 years ago or so, I worked at a company and their drawing's dimscale was displayed down on the status bar/tray near the ortho/snap/grid information. Anyone know if this is something they did custom, or if it is a setting I can turn on somewhere for 2010? Thanks Quote Link to comment Share on other sites More sharing options...
NBC Posted August 19, 2009 Share Posted August 19, 2009 yes, that would be something called MODEMACRO. It can display many variables from within AutoCAD. It uses the DIESEL language (if i remember correctly) Quote Link to comment Share on other sites More sharing options...
yrnomad Posted August 19, 2009 Author Share Posted August 19, 2009 Ok, I see how I can input the text I want, but how do I get it to display the active dimscale? I tried: modemacro "Dimscale (getvar "dimscale") and it displayed just what I typed. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 19, 2009 Share Posted August 19, 2009 In DIESEL: $(getvar,dimscale) In LISP: (getvar "DIMSCALE") Perhaps you might want: (strcat "Dimscale = " (rtos (getvar "DIMSCALE"))) Lee Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted August 19, 2009 Share Posted August 19, 2009 ;This program state user name, dimension scale, current text size, current fillet radius. (defun-q S::STARTUP () (command "modemacro" "Mr YOUR NAME: DSc=$(getvar,dimscale).TSz=$(getvar,textsize). ALT_U=$(getvar,DIMALTF)." ) ) Add this to acad.lsp Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 19, 2009 Share Posted August 19, 2009 Why the defun-q? Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted August 20, 2009 Share Posted August 20, 2009 (defun-q sym ([arguments] [/ variables...]) expr...) The defun-q function is provided strictly for backward-compatibility with previous versions of AutoLISP, and should not be used for other purposes. You can use defun-q in situations where you need to access a function definition as a list structure, which is the way defun was implemented in previous, non-compiled versions of AutoLISP. Sorry Lee, my English is not strong enough to explain so I paste it from AutoLISP Reference Guide. I don't remember how long I use it. Picture below show bottom of Acad2008 ( new toy) and Acad 2002. Have good night Lee! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 20, 2009 Share Posted August 20, 2009 Yeah, I just wondered why defun-q and not just defun... I'm not saying you are wrong - I have never defined an s::startup function myself... Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 20, 2009 Share Posted August 20, 2009 ;This program state user name, dimension scale, current text size, current fillet radius.(defun-q S::STARTUP () (command "modemacro" "Mr YOUR NAME: DSc=$(getvar,dimscale).TSz=$(getvar,textsize). ALT_U=$(getvar,DIMALTF)." ) ) Add this to acad.lsp you shouldn't redefine the S::STARTUP as you are, if it already exists, you are overwriting it with just your startups. instead, try something like: (defun-q MB:STARTUP () (setvar "modemacro" "Mr YOUR NAME: DSc=$(getvar,dimscale).TSz=$(getvar,textsize). ALT_U=$(getvar,DIMALTF).")) (setq S::STARTUP (append S::STARTUP MB:STARTUP)) that way, you just add on, instead of overwriting. i also changed it to setvar, to avoid using command. Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 20, 2009 Share Posted August 20, 2009 here's my modemacro coding, lots of goodies: (setvar "modemacro" "($(edtime, $(getvar,date),H:MMam/pm) - $(edtime,$(getvar,date),M.DD.YY)) Textsize: $(getvar,textsize) $(if, $(!=, $(getvar,viewtwist), 0), Viewtwist: $(angtos, $(getvar,viewtwist) [, 0, 2]) , ) Dimscale: $(getvar,dimscale) $(if, $(!=, $(getvar,filletrad), 0), FilletRad: $(getvar,filletrad), ) $(if, $(=, $(getvar,worlducs), 1),*WCS* ,*NON-WCS*) " ) this will display the date, time, viewtwist (if not 0), filletrad (if not 0), dimscale, textsize and displays WCS or NON-WCS depending on if my ucs changes. Quote Link to comment Share on other sites More sharing options...
DVDM Posted August 20, 2009 Share Posted August 20, 2009 That is awesome! Never knew this was possible. I'm going to go crazy with this one, I'll be working in clean-screen mode soon Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 20, 2009 Share Posted August 20, 2009 you shouldn't redefine the S::STARTUP as you are, if it already exists, you are overwriting it with just your startups.instead, try something like: (defun-q MB:STARTUP () (setvar "modemacro" "Mr YOUR NAME: DSc=$(getvar,dimscale).TSz=$(getvar,textsize). ALT_U=$(getvar,DIMALTF).")) (setq S::STARTUP (append S::STARTUP MB:STARTUP)) that way, you just add on, instead of overwriting. i also changed it to setvar, to avoid using command. Thanks Alan, that helps me understand it a bit more Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 20, 2009 Share Posted August 20, 2009 Thanks Alan, that helps me understand it a bit more happy do help. Quote Link to comment Share on other sites More sharing options...
StevJ Posted August 20, 2009 Share Posted August 20, 2009 This is great, but as I was trying this out, it seems there's a difference between TEXTSIZE and text height. I was hoping that as I changed the text height, the TEXTSIZE value would change to reflect this, but as you can see in the pic below, TEXTSIZE remains 0.08 even though height value is 0.14. The status bar always shows .08, regardless of the height value, and I can find no variable value that corresponds to current text height. What am I doing wrong? Steve Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 20, 2009 Share Posted August 20, 2009 This is great, but as I was trying this out, it seems there's a difference between TEXTSIZE and text height. I was hoping that as I changed the text height, the TEXTSIZE value would change to reflect this, but as you can see in the pic below, TEXTSIZE remains 0.08 even though height value is 0.14. The status bar always shows .08, regardless of the height value, and I can find no variable value that corresponds to current text height.What am I doing wrong? Steve nothing, the (getvar "textsize") refers to the set/default text size. the text height you are looking at is based on the settings of the text style. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 20, 2009 Share Posted August 20, 2009 This will get what you want: (defun tHgt ( ) (vla-get-Height (vla-get-ActiveTextStyle (vla-get-ActiveDocument (vlax-get-acad-object))))) Quote Link to comment Share on other sites More sharing options...
StevJ Posted August 20, 2009 Share Posted August 20, 2009 That clears it up. Thanks. And thanks for that handy bit of code, Lee. Steve Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 20, 2009 Share Posted August 20, 2009 Not a problem Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 20, 2009 Share Posted August 20, 2009 This will get what you want: (defun tHgt ( ) (vla-get-Height (vla-get-ActiveTextStyle (vla-get-ActiveDocument (vlax-get-acad-object))))) sadly, you can't put that in the statusbar Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 20, 2009 Share Posted August 20, 2009 sadly, you can't put that in the statusbar True. shame 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.