Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

[IV 2014] - First view Scale got by VBA different from export to DWG

gmassart
Collaborator

[IV 2014] - First view Scale got by VBA different from export to DWG

gmassart
Collaborator
Collaborator

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
EESignature

0 Likes
Reply
346 Views
2 Replies
Replies (2)

AlexFielder
Advisor
Advisor
I would suggest you share the code you have (if you can) it'll make it easier to help you rather than clutching at straws.
0 Likes

gmassart
Collaborator
Collaborator

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
EESignature

0 Likes