AssociativeDraftView what is it good for?

AssociativeDraftView what is it good for?

Anonymous
Not applicable
512 Views
4 Replies
Message 1 of 5

AssociativeDraftView what is it good for?

Anonymous
Not applicable

Browsing the Drawing functionality of the Inventor API I stumbled on the AddAssociativeDraftView Method.

It's diferent from the AddDraftView Method because it refernces a model.

It's use is quite simple.

The question is when to use it.

What is it good for?

 

Greatings,

Ivan

0 Likes
Accepted solutions (1)
513 Views
4 Replies
Replies (4)
Message 2 of 5

JarFu
Autodesk
Autodesk

Hi Ivan,

 

This API is do the same thing as UI: Place Views> Create> Draft command.

As help mentioned: Method that creates a new associative draft . An empty draft view is created and associated with the input document. The newly created DrawingView is returned.

 

Below is the simple VBA for your trying:

 

Sub TestDraft()
    Dim oDraw As DrawingDocument
    Set oDraw = ThisApplication.ActiveDocument
    
    Dim oDrafView As DrawingView
    Set oDrafView = oDraw.ActiveSheet.DrawingViews.AddAssociativeDraftView( _
        ThisApplication.Documents.Open("C:\temp\box.ipt", False), _
        ThisApplication.TransientGeometry.CreatePoint2d(0, 0))
    
End Sub



Jar Fu
SW Engineer
Inventor QA
Autodesk, Inc.
0 Likes
Message 3 of 5

Anonymous
Not applicable

Thank you very much for your reply Jar Fu!

I used the Draft View command from the Inventor Interface. The slight difference that I noticed is that from the interface the new view is only drawing sketch. On the other hand, from the API the draft view is associated with a model file. I'm curious in what scenario the API function is better.

Greetings,

Ivan

0 Likes
Message 4 of 5

ekinsb
Alumni
Alumni
Accepted solution

Inventor supports the creation of regular drawing views which reference a model and draw the 2D version of the model within the view.  It also supports the creation of draft views which are empty views that you can then draw sketch geometry in and create anything you want.  It's completely independent of any model. 

 

The API supports something that is a bit of a mix of these two.  It's like a draft view in that it's empty and you can create your own sketch geometry but it's like a regular drawing view in that it references a model.  The reason this exists in the API is so that someone can use this to create a view that draws some unique representation of the referenced model that Inventor doesn't support. By having the reference to the model the add-in can find the model that the associative draft view is associated with and can read the model and update the contents of the view.

 

It's a very narrow use case and very few people have needed it but for those that needed it, it was a necessity.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 5 of 5

Anonymous
Not applicable

Hello Brian!

Thank you for your reply. You anticipated my previous post by seconds.

Now that you mentioned it, I see that trough the API the sketch in the draft view can be updated to correspond to a certain change in the model.

 

Greetings,

Ivan

0 Likes