The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hurricane for AutoCAD
 Tips and Tricks
 DIMSCALE in TITLEBLOCK (or any System Variable!?)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Admin
Administrator



651 Posts

Posted - July 15 2003 :  7:05:48 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
This message was put in the Lisp section...

Would anyone be able to convert this lisp so that it can accept any system variable as the third prompt?

Block:
Attribute:
SysVar:

Rather than having it hard-coded to be DIMSCALE?

http://www.74mph.com/forum/topic.asp?TOPIC_ID=77

I'm afraid this might be more that I can chew.
(Or I'm missing something simple)

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html

lurkfear
New Member



11 Posts

Posted - July 29 2003 :  12:53:47 PM  Show Profile  Visit lurkfear's Homepage  Reply with Quote
I was recently doing some research for RTEXT concerning DIESEL string expressions . In AutoCAD's help system there is a huge section on how to get the output of a known system variable with lisp.

Einstein said that insanity is doing the same thing over and over expecting different results.
Go to Top of Page

Admin
Administrator



651 Posts

Posted - July 29 2003 :  2:01:54 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Thanks... my help files seem all screwed up...

I've made a change, and you can enter the SYSVAR of your choice... however, there seems to be an issue with the format of the sysvar outputted.

For instance, if my OSMODE is 231, and want to put that in the title-block, then this routine returns 231.0000. (This can be fixed... below)

You can see from these two lines, that the RTOS has two parameters, cause you have to convert the Number to a String... BUT, it would be nice to be able to truncate any trailing zeros!

The first line is commented out in the lisp, but has the two parameters... you can change the 0 to a 2 for 2 places after the decimal). The second line, doesn't have any parameters, so the conversion goes without any modification.

;(setq newatt1 (RTOS (getvar newatt1) 2 0))
(setq newatt1 (RTOS (getvar newatt1)))

The problem is when you try to put something like LTSCALE (if it was 1.35 for instance), with
;(setq newatt1 (RTOS (getvar newatt1) 2 0))
you would get 1 instead of 1.35. (I'm still not quite sure about the first parameter being "2", which is called "mode", maybe this is the key..., but again, my help is all screwed up... I had my hopes up with much mention to the DIMZIN system variable, and how it effects RTOS in the newsgroups. I played with it, but it doesn't seem to effect my output... Argh...

I'm not sure if there is an easy way to trim ".000" from a string (if it exists), or just any trailing zero (in the case of "1.35000"). Again, I'm not that familiar with lisp, but with the above in mind, you can easily add the parameter to the lisp before running it, or remove it.

I'd love a solution that took care of this automatically!!

Here is the new file...
Download Attachment: TB_WIZ1_SYSVAR.zip
1.1 KB

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

lurkfear
New Member



11 Posts

Posted - July 29 2003 :  2:13:15 PM  Show Profile  Visit lurkfear's Homepage  Reply with Quote
How about converting the real number to an integer before making it a string?

Einstein said that insanity is doing the same thing over and over expecting different results.
Go to Top of Page

lurkfear
New Member



11 Posts

Posted - July 29 2003 :  2:17:01 PM  Show Profile  Visit lurkfear's Homepage  Reply with Quote
Or how about GETINT?

Einstein said that insanity is doing the same thing over and over expecting different results.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.34 seconds. Snitz Forums 2000