Author Topic: Dimscale  (Read 2542 times)

0 Members and 1 Guest are viewing this topic.

Luke

  • Guest
Dimscale
« on: January 02, 2008, 08:56:38 AM »
I want a button that when I click it will do the following.

If the dimension style that is set current contains the text “std” clicking the button will set the dimscale to 16 and the textsize to 2.

OR

If the dimension style that is set current contains the text “mm” clicking the button will set the dimscale to 406.4 (16 x 25.4) and the textsize to 50.8 (2 x 25.4).

Is it possible and what would be the easiest way to do it?
« Last Edit: January 02, 2008, 01:24:28 PM by Luke »

deegeecees

  • Guest
Re: Dimscale
« Reply #1 on: January 02, 2008, 11:46:15 AM »
Yes, do you need a nudge, or do you want the whole fish?

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Dimscale
« Reply #2 on: January 02, 2008, 12:01:45 PM »
Here is one way to do it:

Code: [Select]
(cond ((wcmatch (strcase (getvar 'dimstyle)) "*STD*")
       (setvar 'dimscale 16)(setvar 'textsize 2)
      )
      ((wcmatch (strcase (getvar 'dimstyle)) "*MM*")
       (setvar 'dimscale 406.4)(setvar 'textsize 50.5)
      )
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Luke

  • Guest
Re: Dimscale
« Reply #3 on: January 02, 2008, 01:21:24 PM »
I'd love the whole fish  ;-)

I'd prefer the nudge.  Y'all give me the whole fish plenty.  I'm never gonna get there myself if I don't try.  Biggest hurdle right now is that I don't really have time for trial and error and trouble shooting all day at work and when I get home my home PC is not setup right now.

Luke

  • Guest
Re: Dimscale
« Reply #4 on: January 02, 2008, 01:35:07 PM »
Again as you've helped me in previous posts I'm way unfamiliar with lisps.  Just familiar enough with macros and scripts to be dangerous.

Will this code be a lisp and loaded through the appload command?

deegeecees

  • Guest
Re: Dimscale
« Reply #5 on: January 02, 2008, 01:53:53 PM »
Not tested, but here's yer fish. Same as it ever was, just drag to your AutoCad, or appload it. All credit goes to ronjonp for his conditional statements.

Code: [Select]
(defun c:Luke_Dim ()
(cond ((wcmatch (strcase (getvar 'dimstyle)) "*STD*")
       (setvar 'dimscale 16)(setvar 'textsize 2)
      )
      ((wcmatch (strcase (getvar 'dimstyle)) "*MM*")
       (setvar 'dimscale 406.4)(setvar 'textsize 50.5)
      )
)
)

Luke

  • Guest
Re: Dimscale
« Reply #6 on: January 02, 2008, 01:57:17 PM »
ronjonp thank you.

And deegeecees thank you also for the fish.

Just incase you care, I actually figure out the part you added on my own about 5 min before you posted.  I do appreciate you help just the same!

deegeecees

  • Guest
Re: Dimscale
« Reply #7 on: January 02, 2008, 01:59:42 PM »
Good to see you're learning. Glad to help.

 :-)

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Dimscale
« Reply #8 on: January 02, 2008, 04:04:52 PM »
Glad to help out :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC