- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
[IV 2014] - First view Scale got by VBA different from export to DWG
Hi
I have a strange behavior
As many users we have vba macro (a basic for each on the DrawingViews taking into consideration the first one) that get the first view scale to populate the titleblocks of drawings.
But I have an issue
On few sheets of a drawing the scale got from the macro is not the first one, but another one. Strangely when I export to DWG with "scale of the first view" for the object space, that is the good one.
Strangely, the scale of the view got by the macro is from a section view, wich cannot be the first one of a page as it depends on another view that has to be inserted before...
So question is : what could be the issue there ?
Thank you
Guillaume MASSART
AFFIVAL SAS
Inventor Pro 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Alex Fielder
Inventor Expert
https://github.com/alexfielder/
LinkedIn - Github Inventor Extension Server - Bonkers polygon iLogic thing
Top ten iLogic Tips - API Shortcut In Google Chrome - Assembly Extrusion Example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here is it :
Public Sub Title_block_scale_insertion(sProperty As String, oSheet As Sheet)
'insert the scale of the first view of a sheet
Dim oTextBox As Inventor.TextBox
If oSheet.DrawingViews.Count > 0 Then
For Each oTextBox In oSheet.TitleBlock.Definition.Sketch.TextBoxes
If oTextBox.FormattedText = sProperty Then
Call oSheet.TitleBlock.SetPromptResultText(oTextBox, Replace(Replace(oSheet.DrawingViews(1).ScaleString, ":", "/"), " ", ""))
End If
Next oTextBox
End If
End Sub
Guillaume MASSART
AFFIVAL SAS
Inventor Pro 2022