Message 1 of 3
Change scale and position of drawing view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Changing position and scale is not working for me. Anyone know this?
Sub IdwPart()
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
strLocation = ThisApplication.FileOptions.TemplatesPath
Set oDrgDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, strLocation & "A3.idw")
Dim oSheet As Sheet
Set oSheet = oDrgDoc.Sheets.Item(1)
Dim oPoint1, oPoint2 As Point2d
Set oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(10, 10)
Set oPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(10, -5)
Dim oBaseView, top As DrawingView
Set oBaseView = oSheet.DrawingViews.AddBaseView(oDoc, oPoint1, 1, kFrontViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle)
Set top = oSheet.DrawingViews.AddProjectedView(oBaseView, oPoint2, DrawingViewStyleEnum.kFromBaseDrawingViewStyle)
'scale value
Dim scle As Double
scle = (29.7 - 17) / (oBaseView.Height + top.Height)
Dim a, s As String
a = ":1"
s = scle & a
Select Case scle
Case Is > 1.5
oSheet.Size = kA4DrawingSheetSize
oBaseView.ScaleString = s
oBaseView.Position.X = 15
Case 0.4 To 1.5
oSheet.Size = kA3DrawingSheetSize
oBaseView.ScaleString = s
oBaseView.Position.X = 21
End Select
End Sub