Hi is there an easy way to check if the Scale String entered for a drawing view is valid?
I use the IsExpressionValid quite a lot for checking length and other values so was just wondering if there is something to validate the Scale String also.
Hi @Raider_71. I don't recall seeing a tool for verifying scale strings, but they are usually fairly simple as far as formatting. Since it always represents a ratio (or percentage) between model size and view size, there are two main ways to format it. When the view is going to be larger than model size, there is a larger first number, then a colon":", then a smaller second number in the string, which would translate into a top heavy fraction, which would evaluate to a decimal value that is greater than one. When the view is smaller than the model, there is usually a smaller number, then a "/", then a larger number in the String, which already represents a bottom heavy fraction, which represents a decimal value less than one.
You can fill in your list of available 'preset' view scale strings in the Style & Standards Editor, while your main active 'Standard' is selected, then go to the General tab on the right, and select Scale from the drop-down list under the Preset Values' section. That list can also be easily filled in by code too.
DrawingDocument.StylesManager.ActiveStandardStyle.PresetScales
Wesley Crihfield
(Not an Autodesk Employee)
Hi @WCrihfield
Thanks for confirming. Yes there are a couple of ways to format the scale string including the Architectural formatting which includes a "=" symbol also. I think I have managed to write a routine to cater for all the different types and can evaluate what I need. It did take a while so this could be something nice for Autodesk to add.
You could make a post in the Inventor Ideas forum about it if you wanted, then paste a link to that post back here so that others could find it in the future. It might not be in that much demand though, so it may be difficult to get implemented.
Wesley Crihfield
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.