PDA

View Full Version : Fixing textstyle scaling



amaser
2009-08-03, 04:42 PM
I'm trying to convert some of my vba code to .net, using Visual Studio 2008.

what my routine is doing is cycling through the textstyles collection, and looking for certain textstyle names, to set the appropriate height for our standard styles.

i was using a for/next loop to cycle through the textstyles collection, but can't find what to set the collection variables to to make itwork. can someone tell me how to do this? or if there's a better way to acoomplish my task?

here's the initial problem: we have 10 or 12 standard text styles set up in our template. they are annotative with specific 'Paper text heights' set.

when we change drawing scales, the paper text height gets scaled, which is not what i want. i want the paper height to stayt he same, and the model height to get scaled.
i wrote the vba script to reset them, and it works, now i'm trying to upgrade

RobertB
2009-08-03, 10:44 PM
How are you changing drawing scales? That is the real issue. The paper space height should not be changing on text styles with the Annotative property set to True.

amaser
2009-08-04, 12:44 PM
i've had it happen both from the Projects menu, and also when changing the annotation scale on the status bar. (though it doesn't always happen in this case)


How are you changing drawing scales? That is the real issue. The paper space height should not be changing on text styles with the Annotative property set to True.

RobertB
2009-08-04, 03:06 PM
i've had it happen both from the Projects menu, and also when changing the annotation scale on the status bar. (though it doesn't always happen in this case)We use annotative text styles and have never seen this. Are the values for you changing by the difference in the scale factors? Or is it some small value, e.g. from 0.1 to 0.09375?

I'm still guessing there is some other customization that is interferring with you.

amaser
2009-08-04, 03:18 PM
We use annotative text styles and have never seen this. Are the values for you changing by the difference in the scale factors? Or is it some small value, e.g. from 0.1 to 0.09375?

I'm still guessing there is some other customization that is interferring with you.

it's definitely by the scale factor. for example, our 0.1" text when adjusted to 20 scale, the paper text height will say 2, the .08 size will say 1.6 etc.

i'm not really interested in figuring out why, i'm more interested in figuring out how to convert my vba program to .net, since the program works well

RobertB
2009-08-04, 06:11 PM
i'm not really interested in figuring out why, i'm more interested in figuring out how to convert my vba program to .net, since the program works wellYeah, I'd figured you would eventually tell me that. :|

Iterate thru the collection, getting the object IDs for each style. Once you have the object ID you can use that to get the actual object, where you can compare the name and do your work.

amaser
2009-08-04, 06:15 PM
Yeah, I'd figured you would eventually tell me that. :|

Iterate thru the collection, getting the object IDs for each style. Once you have the object ID you can use that to get the actual object, where you can compare the name and do your work.

the problem i have is that i can't figure out how to setup the collection. this is what i need corrected

Dim myColl as xxxxx (however, i specify collection)

set myColl = thisdwg,.... etc to set up the actual textstyles collection.

then i've got a for-next, with an embedded case-select to set the ones i want.