Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
My question is about the code I found on the following link:
Code is used to scale the chosen view and I have added a line to center it.
I have placed a few questions next to the code lines, so if somebody finds the time to answer them it would be great.
ThisApplication.ActiveDocument.Sheets("Sheet:2").Activate Dim oDwgDoc As Document oDwgDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet oSheet = oDwgDoc.Sheets.Item(2) Dim oView As DrawingView oView = oSheet.DrawingViews.Item(1)
oView.ScaleString = "1:1" -> I believe this sets the temporary scale of the view? Dim ViewWide As Double ViewWide = 35 '-> what is here 35? I know Inventor works with centimeters so I assume those are cm? Dim DrawingScale As String DrawingScale = CStr(ViewWide / oView.Width) -> is oView.Width calculated when scale is 1:1 like defined here: oView.ScaleString = "1:1"
-> why is here CStr used? I have read CStr is used to variable conversion? oView.ScaleString = DrawingScale ActiveSheet.View("VIEW4").SetCenter(148.5,210) -> what should I put to center the view? I have used mm (I use A3 sheet format) but It does not place the view in the middle of the sheet.
Tom
Solved! Go to Solution.