Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Check if valid Scale string

3 REPLIES 3
Reply
Message 1 of 4
Raider_71
236 Views, 3 Replies

Check if valid Scale string

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.

3 REPLIES 3
Message 2 of 4
WCrihfield
in reply to: Raider_71

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

EESignature

(Not an Autodesk Employee)

Message 3 of 4
Raider_71
in reply to: Raider_71

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.

Message 4 of 4
WCrihfield
in reply to: Raider_71

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

EESignature

(Not an Autodesk Employee)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report