Lt Dan's legs Posted August 12, 2010 Posted August 12, 2010 I'd like to start off by saying this lisp is not 100% complete. I'm working on this not because I have a need for it, but I wanted to have some routines I can show off. I don't want to use VL because I haven't made it that far. Problems: Unit's and precision do not work on this. I know how to change it but wonder, what's the best way of doing it? Condition argument? example of what I was planning on doing: (cond ((eq "Architecture" unit)(setq u 4)... and so on Just looking for tips and suggestions. Thanks MTool.zip Quote
The Buzzard Posted August 13, 2010 Posted August 13, 2010 I'd like to start off by saying this lisp is not 100% complete. I'm working on this not because I have a need for it' date=' but I wanted to have some routines I can show off. I don't want to use VL because I haven't made it that far. Problems: Unit's and precision do not work on this. I know how to change it but wonder, what's the best way of doing it? Condition argument? example of what I was planning on doing: (cond ((eq "Architecture" unit)(setq u 4)... and so on Just looking for tips and suggestions. Thanks[/quote'] I used something like this in an old dimstyle program I wrote. This is from that program, To give you an example : (cond ((= UNT "Decimal") (setvar "DIMLUNIT" 2)) ((= UNT "Engineering") (setvar "DIMLUNIT" 3)) ((= UNT "Architectural")(setvar "DIMLUNIT" 4)) ((= UNT "Fractional") (setvar "DIMLUNIT" 5))) Use setvar and DIMLUNIT to set your units. I think you will get the idea. Also look into: System Variables LUNITS Sets linear units LUPREC Sets the number of decimal places displayed for all read-only linear units, and for all editable linear units whose precision is less than or equal to the current LUPREC value MEASUREINIT Sets the initial drawing units as imperial or metric MEASUREMENT Sets drawing units as imperial or metric for the current drawing only UNITMODE Controls the display format for units Quote
Lt Dan's legs Posted August 13, 2010 Author Posted August 13, 2010 (cond ((= UNT "Decimal") (setvar "DIMLUNIT" 2)) ((= UNT "Engineering") (setvar "DIMLUNIT" 3)) ((= UNT "Architectural")(setvar "DIMLUNIT" 4)) ((= UNT "Fractional") (setvar "DIMLUNIT" 5))) Thank you for taking a look at this. Wouldn't this change the setting rather than temporarily change the settings like (cond ((eq "architecture" unit)(setq u 4)))... (rtos di (atoi u)(atoi p)) Quote
The Buzzard Posted August 13, 2010 Posted August 13, 2010 Thank you for taking a look at this. Wouldn't this change the setting rather than temporarily change the settings like (cond ((eq "architecture" unit)(setq u 4)))... (rtos di (atoi u)(atoi p)) Im sorry, I was under the impression you wanted to change the setting. Could you be more specific as to what your aim is? Quote
Lt Dan's legs Posted August 13, 2010 Author Posted August 13, 2010 I'm sorry. I know I have a problem with making things clear. Ill post tomorrow because I'm on my phone. its hard to type on. Again, thank you for your time. Quote
The Buzzard Posted August 13, 2010 Posted August 13, 2010 No problem. See you then unless you have got your answer by that time. Good Luck Quote
BIGAL Posted August 13, 2010 Posted August 13, 2010 If your writing the program then change all required variables in one go to what you want not the person drafting so it always works, just remember to save them back to the original settings when the program is finished a couple of hints always do angular calculations in radians autocad is written that way and working in degrees can sometime using default unit settings not work the way you expect. Were lucky were metric so dont have to worry about feet & inches. Quote
Lt Dan's legs Posted August 13, 2010 Author Posted August 13, 2010 Thank you for all the help. I got it to work. Suggestions on how to improve are greatly appreciated. Mtoolv1.1.zip Quote
Lt Dan's legs Posted August 13, 2010 Author Posted August 13, 2010 New question but for the same job. I was thinking it would be great if the unit's popup list changed the wording of the precision popup list. Is this possible in dcl? Example if in architectural the popup list would display 1/4" 1/8" etc and if in Decimal it would display 0.0 0.00 etc Quote
Tharwat Posted August 13, 2010 Posted August 13, 2010 You can do that with mapcar add_list but the contents must be clear to user to know the right choose for the conversion. Regards, Quote
Lt Dan's legs Posted August 13, 2010 Author Posted August 13, 2010 What's your Honest opinion of this program? I realize it's probably not useful to anyone but it was a great training tool for me to write. Quote
The Buzzard Posted August 13, 2010 Posted August 13, 2010 New question but for the same job. I was thinking it would be great if the unit's popup list changed the wording of the precision popup list. Is this possible in dcl? Example if in architectural the popup list would display 1/4" 1/8" etc and if in Decimal it would display 0.0 0.00 etc Here is an example by Lee, I used it in my ANSI Flange Lisp in my signature. Example.dcl Example.lsp Quote
Lt Dan's legs Posted August 13, 2010 Author Posted August 13, 2010 Nice! thank you "Shame you can't afford it! :)" Quote
Tharwat Posted August 13, 2010 Posted August 13, 2010 . I was thinking it would be great if the unit's popup list changed the wording of the precision popup list. Is this possible in dcl? My answer was directed to your question about if it is possible' date=' and I said you can do ... but .... And to give you a [b']honest[/b] opinion, I do not have one in mind right now, but if I had once, I would give it to you . certainly Good luck. Quote
Lee Mac Posted August 14, 2010 Posted August 14, 2010 Nice! thank you "Shame you can't afford it! :)" :) :) 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.