Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
Thanks to @JelteDeJong I know how to managed the rescale views in my drawings,
But I would like to only have ISO scale like :
1/200
1/100
1/50
...
Until 200/1
Do you know a way to "round" the value from this code or maybe set another parameter instead of giving dimension in (view, 10, 10) to have ISO scale ?
Thanks in advance,
Public Sub Main()
Dim frontView As DrawingView = sheet.DrawingViews.Cast(Of DrawingView).Where(Function(v) v.Name = "FRONT VIEW").FirstOrDefault()
If (frontView Is Nothing) Then
MsgBox("Front view not found")
End If
ReScaleView(frontView, 10, 10)
End sub
Public Sub ReScaleView(view As DrawingView, X As Double, Y As Double)
If (view.ScaleFromBase) Then Return
Dim XOrg As Double = view.Width / view.Scale
Dim YOrg As Double = view.Height / view.Scale
Dim XScale As Double = X / XOrg
Dim YScale As Double = Y / YOrg
view.Scale = Math.Min(XScale, YScale)
Solved! Go to Solution.