TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: donniedrake on October 23, 2014, 11:10:59 AM

Title: Scale button to quickly set ltscale do desired scale?
Post by: donniedrake on October 23, 2014, 11:10:59 AM
Just started with a new company and they have very old lsp routines that aren't functioning. I'm trying to create a button that will pop up a box and set the ltscale to the scales used here. Also set the dimscale to match the selected scale. Anything out there already? Started this lsp, but fairly new to lsp so any help would be much appreciated!
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: BlackBox on October 23, 2014, 11:32:22 AM
Welcome to TheSwamp!

Not sure what version(s) you're now using, but is there any chance of moving to Annotative Scales instead?

I ask, as changing a drawing's Model, or PViewport annotation scale automagically modifies linetype and dim-scales for you... To test for yourself, use LTSCALE == 1, MSLTSCALE == 1, and PSLTSCALE == 1 (and some pre-defined annotation scales, of course).

[Edit] - This would also allow you to use the in-built UI, precluding the need for a custom dialog.



Example:

Code: [Select]
Command: SYSVARWATCH

SYSVARWATCH = ON

Command:
Command: _CANNOSCALE
Enter new value for CANNOSCALE <"1" = 20'">: 1" = 30'

[SysVarWatch] : System Var Changed      : DIMSCALE = 30.0
[SysVarWatch] : System Var Changed      : CANNOSCALE = 1" = 30'

Command: SYSVARWATCH

SYSVARWATCH = OFF

Command:

Cheers
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: dgorsman on October 23, 2014, 11:37:35 AM
One addendum to BlackBox's comment above - if you are using linetypes from ACAD.LIN in a metric drawing, chances are the global LTSCALE setting will be 10 rather than 1.
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: BlackBox on October 23, 2014, 11:41:15 AM
One addendum to BlackBox's comment above - if you are using linetypes from ACAD.LIN in a metric drawing, chances are the global LTSCALE setting will be 10 rather than 1.

Thank you, Sir; I do often neglect metric. *Tips hat*

Cheers
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: donniedrake on October 23, 2014, 12:25:56 PM
Using ACAD Map 11, primarily need to set the ltscale so blocks are inserted to the desired/selected scale.
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: BlackBox on October 23, 2014, 12:28:09 PM
Using ACAD Map 11, primarily need to set the ltscale so blocks are inserted to the desired/selected scale.

Good; so if you set your block as annotative, it will automagically display at the correct size, so long as your drawing's Model, or PViewport annotation scale is set accordingly. :-)

Cheers
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: donniedrake on October 23, 2014, 12:38:22 PM
Gotcha, I'll try and see how they are running the annoscale, they have blocks all over the place with different scales and properties. Kind of a cluster here :)
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: BlackBox on October 23, 2014, 12:39:27 PM
Gotcha, I'll try and see how they are running the annoscale, they have blocks all over the place with different scales and properties. Kind of a cluster here :)

No worries; just be sure to back everything up before you modify. :angel: #CYA
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: dgorsman on October 23, 2014, 02:23:15 PM
One addendum to BlackBox's comment above - if you are using linetypes from ACAD.LIN in a metric drawing, chances are the global LTSCALE setting will be 10 rather than 1.

Thank you, Sir; I do often neglect metric. *Tips hat*

Cheers

*#@#^ Imperials.  Rebel Metric Alliance, rise up!   :-P
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: roy_043 on October 23, 2014, 02:27:12 PM
At the risk of sounding obvious... Shouldn't you use acadiso.lin for metric drawings?
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: ronjonp on October 23, 2014, 02:36:50 PM
At the risk of sounding obvious... Shouldn't you use acadiso.lin for metric drawings?
Exactly .. if your MEASUREMENT  (http://help.autodesk.com/view/CIV3D/2015/ENU/?guid=GUID-1D074C55-0B63-482E-8A37-A52AC0C7C8FE)variable is set correctly, you should not have to worry about it.
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: dgorsman on October 23, 2014, 03:51:38 PM
At the risk of sounding obvious... Shouldn't you use acadiso.lin for metric drawings?

Yes.  But a number of companies that have been around for a while continue to use ACAD.LIN with an appropriate global LTSCALE.  It took quite an effort to get my own users on board with using units-correct data files.  Up to that point they were merrily going along since it worked.  If they needed a linetype they would find any ACAD.LIN file (why look at something else?) and load from there.  There wasn't any reason for them to look at other files until MSLTSCALE and PSLTSCALE came along and made life difficult for them.  That, and I implemented automation which loads everything for them from the appropriate files.
Title: Re: Scale button to quickly set ltscale do desired scale?
Post by: donniedrake on October 23, 2014, 04:04:35 PM
And that's exactly where I'm at, I dont see them listening or wanting to get with the times either. Just set the ltscale and run......frustratedly!