Sheef format scale macro?

Hi all,

I've realized I need a funky macro. I am wasting a lot of time resetting the sheet format scale of my drawings. Whenever I create a

3view drawing of a part SW guesses at a scale factor which is never close to what I want. I also don't always know what I want so then this pattern begins:

1: right click on sheet format

2: left click on properties 3: type in new scale 4: click ok 5: see new scale and return to step 1 if necessary

What I would like to do is make a macro that popped up a small dialogue with a spin box or something so that I could dynamically click 'up' or 'down' the sheet format scale until I'm happy.

What do you think?

Zander

Reply to
Zander
Loading thread data ...

Are you asking for someone to write it for you or are you asking if it is a good idea. I think it is a good idea I deal with the same thing all the time. It isn't all that much to code it. This will get you started

Set swApp = Application.SldWorks

Set dwgdoc = swApp.ActiveDoc

Set Thissheet = dwgdoc.GetCurrentSheet Numerator = 1 Denominator = 2

ThisSheet.SetScale(Numerator,denominator,false,true) dwgdoc.Rebuild (swRebuildAll)

Corey

Zander wrote:

Reply to
CS

I liked the idea so much, that I took the code that Corey started and wrote a complete macro for it. I don't have anywhere to post it but I can can email it to you if you want.

Ken

Reply to
Tin Man

I will put it on our user group site if you wish.

WT

Reply to
Wayne Tiffany

Sounds good to me. I'll email it to the email address at:

formatting link

Ken

Reply to
Tin Man

formatting link
Here you go. I played with it a bit and it's cool. However, I found that after I plopped the views onto the sheet, and then started the macro, I couldn't drag the views around to reposition them while still in the macro. I had to picture in my mind whether or not the new view scale would still be correct after moving them. Maybe something for your spare time. :-) Other than that, it was fun - thanks.

WT

Reply to
Wayne Tiffany

Wayne, Good idea. It's actually quite a simple change. I'll forward the updated macro to you. Thanks for posting it, Ken

Reply to
Tin Man

Thanks you guys!

Most appreciated and it works great! Although the old version is still the posted one I think. Please email me the latest if you don't mind.

Zander

Reply to
Zander

Ahhh, much better! The new one is there now - sorry for the delay.

WT

Reply to
Wayne Tiffany

Works great! I've been needing a macro like this for years.

The only problem I am having with it is with text that is locked to the sheet focus. Doing the old fashioned method of going to the sheet properties to change scale, when clicking OK, another dialog would pop-up with:

Do you want to... _ Scale the annotations' position _ Scale annotation's text height

For some unknown reason, "Scale the annotations' position" is always checked by default. I personally want it to be unchecked by default, or at least remember my preferences from the last time I did it. It doesn't though. Every time I adjust the scale I have to uncheck this option.

But, with the macro and this default behavior combined, it will always "Scale the annotations' position" when adjusting the scale in the macro. How can I turn off this default setting?

Reply to
Seth Renigar

formatting link
Amazing, isn't it, how a request from one person just clicks with someone else and they pick up the challenge and run with it. Per Seth's request, Ken has created a newer version of his macro that includes the annotation settings. Here is his explanation.

"I updated the original macro to act as he suggested. Then I also made a copy of the original and added a couple checkboxes to it to allow the user to change the values that Seth was talking about if they'd prefer that instead.

FYI, the way it remembers the user's previous settings was accomplished by writing a text file (SW-ScaleDrawingSheetPreviousSettings.dat) to the C:\Temp\ directory."

I posted both of them on our user group site. Good job, guys!

WT

"Seth Renigar" wrote in message news:qn2pe.11977$ snipped-for-privacy@twister.southeast.rr.com...

Reply to
Wayne Tiffany

Thanks, I have always been frustrated by the lack of this functionality. You've saved me a few gray hairs. Really like the annotations check box addition.

Regards

John Layne

Reply to
John Layne

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.