Quantcast
Channel: From the Trenches with Autodesk Inventor
Viewing all articles
Browse latest Browse all 61

iLogic : Set View Scale from Standard Preset Set List

$
0
0

 Issue:

You would like to set the view scale of your drawing views using the predefined scale list as found at Manage tab > Styles Editor button > Standard > Standard name> General tab > Preset Values> Scale




Solution:

Here is a quick bit of code to get this list and set the scale based on the scale selected from the input list box.

( Thank you! to Zach B. for the idea for the rule) 





DimoDocAsDrawingDocument = ThisApplication.ActiveDocument
DimoStyleManagerAsDrawingStylesManager = oDoc.StylesManager

DimoActiveStandardAsDrawingStandardStyle
oActiveStandard = oDoc.StylesManager.ActiveStandardStyle

DimoListAsNewList(OfString)
ForEachoItemInoActiveStandard.PresetScales
oList.Add(oItem)
Next

DimoViewAsDrawingView
oCurrentScale = oDoc.ActiveSheet.DrawingViews.Item(1).ScaleString

DimoScaleAsString = InputListBox("Select a scale", _
oList, oCurrentScale, "iLogic", "Standard Scale List")

IfString.IsNullOrWhiteSpace(oScale) ThenExitSub

ForEachoViewInoDoc.ActiveSheet.DrawingViews
IfoView.ScaleFromBase = FalseThen
oView.ScaleString = oScale
EndIf
Next



Viewing all articles
Browse latest Browse all 61

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>