Can't add drawing overlay view without additional positional representation

Can't add drawing overlay view without additional positional representation

jdasilvaS39UQ
Advocate Advocate
311 Views
3 Replies
Message 1 of 4

Can't add drawing overlay view without additional positional representation

jdasilvaS39UQ
Advocate
Advocate

Hi,

 

I'm using Inventor 2023.2.1 and when I try to add an overlay view on a drawing, it errors out. The problem is the second argument, If I try "[Primary]" it gives an error if I don't go add an additional positional rep to my assembly. I can't find a way around this I believe it is a bug.

 

sparesSheet.DrawingViews.AddOverlayView(oDrawingView, oDrawingView.ActivePositionalRepresentation, "Spare Parts", False, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle, False)

 

0 Likes
312 Views
3 Replies
Replies (3)
Message 2 of 4

A.Acheson
Mentor
Mentor

Hi @jdasilvaS39UQ 

Have you tried AddOverlayView2 method where you can input modelstate.

 

Syntax

DrawingViews.AddOverlayView2ParentView As DrawingViewModelState As String, PositionalRepresentation As String, DesignViewRepresentation As String, DesignViewAssociative As Boolean, ViewStyle As DrawingViewStyleEnum, [ShowLabel] As Boolean, [Name] As String ) As DrawingView

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 4

jdasilvaS39UQ
Advocate
Advocate

addoverlayview2 has the same issue.

 

see my post here for full details on this issue

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/view-rep-ilogic-not-acting-the-same-... 

0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

This post sounds exactly like what is going on in this other post.  I suggested there that you should check the value of the DrawingView.ActivePositionalRepresentation in an earlier line of code, before supplying that as the input to that method.  If its value is either "[Master]", "[Primary]", or an empty String, then you should supply an empty String as the input into that method instead.  I believe that if the model of he view does not have any custom positional representations present, it may simply not like you trying to specify one by name, since that control is greyed out in the manual dialog.  And if its value is something else, let it use that positional representation name as input, as you normally would, but maybe have it both ways inside of an If...Then block.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes