Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sheef format scale macro?

55 views
Skip to first unread message

Zander

unread,
Jun 2, 2005, 7:53:32 AM6/2/05
to
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

CS

unread,
Jun 2, 2005, 3:13:27 PM6/2/05
to
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

Tin Man

unread,
Jun 3, 2005, 12:35:50 PM6/3/05
to
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

Wayne Tiffany

unread,
Jun 3, 2005, 1:47:41 PM6/3/05
to
I will put it on our user group site if you wish.

WT

"Tin Man" <sendspam...@yahoo.com> wrote in message
news:1117816550....@g49g2000cwa.googlegroups.com...

Tin Man

unread,
Jun 3, 2005, 2:00:39 PM6/3/05
to
Sounds good to me. I'll email it to the email address at:
http://kcswug.com/

Ken

Wayne Tiffany

unread,
Jun 3, 2005, 6:34:19 PM6/3/05
to
http://kcswug.com/programs/macros/ScaleDrawingSheet.swp

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


"Tin Man" <sendspam...@yahoo.com> wrote in message

news:1117821639.4...@g43g2000cwa.googlegroups.com...

Tin Man

unread,
Jun 4, 2005, 1:52:14 PM6/4/05
to
Wayne,
Good idea. It's actually quite a simple change. I'll forward the
updated macro to you.
Thanks for posting it,
Ken

Zander

unread,
Jun 6, 2005, 8:54:16 AM6/6/05
to
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

Wayne Tiffany

unread,
Jun 6, 2005, 9:22:05 AM6/6/05
to
Ahhh, much better! The new one is there now - sorry for the delay.

WT

"Zander" <bka...@gmail.com> wrote in message
news:1118062456.5...@g14g2000cwa.googlegroups.com...

Seth Renigar

unread,
Jun 6, 2005, 4:30:14 PM6/6/05
to
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?

--
Seth Renigar
Emerald Tool and Mold Inc.
(Remove ".no.spam" from my address)
__
"Wayne Tiffany" <wayne.tiff...@asi.com> wrote in message
news:16Yoe.5$Zj.5...@news.sisna.com...

Wayne Tiffany

unread,
Jun 7, 2005, 9:54:53 AM6/7/05
to
http://kcswug.com/programs/macros/ScaleDrawingSheetAnnoText.swp

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" <srenigar...@emeraldtoolandmold.no.spam.com> wrote in
message news:qn2pe.11977$az3.1...@twister.southeast.rr.com...

John Layne

unread,
Jun 7, 2005, 6:02:12 PM6/7/05
to
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

0 new messages