iLogic get preparation drawing view document

iLogic get preparation drawing view document

Nejc.Leban
Advocate Advocate
53 Views
2 Replies
Message 1 of 3

iLogic get preparation drawing view document

Nejc.Leban
Advocate
Advocate

Hello everyone,

 

I'm trying to get the part document of a "Preparation" placed drawing view. On the image below, 10796-07-001-00.iam is the main weldment document. VIEW719 is pos.8 and VIEW720 is pos.11 (10796-06-001-11.ipt). These two are placed on the drawing via Place Views - Base - Model - Preparation(select part), see second image below. What I'm trying to get with iLogic is the part document of each placed view.
Some context - I have automated the placement of views of all occurrences in an assembly. I would now like to check if a view of an occurrence already exists so it doesn't place another view.

 

NejcLeban_0-1757502837095.png

 

NejcLeban_2-1757502989137.png

 

I've tried with this:

Dim oViewDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument

and this: 

Dim viewModelDoc = ActiveSheet.View("VIEW720").ModelDocument.DisplayName

But it gives me the main assembly document and not the part document.

I suppose there's a relatively simple way to get the referenced part, but I can't find it.

 

I'd really appreciate any suggestions.

Best regards.

 

0 Likes
Accepted solutions (1)
54 Views
2 Replies
Replies (2)
Message 2 of 3

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @Nejc.Leban .
In this case, you can get an object of type ComponentOccurrence using the DrawingView.GetWeldmentState method. Example iLogic code:

Dim oInvApp As Inventor.Application = ThisApplication
Dim oView As DrawingView
oView = oInvApp.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select View...")
If oView Is Nothing Then Exit Sub
Dim eWeld As WeldmentStateEnum
Dim oObj As Object
Call oView.GetWeldmentState(eWeld, oObj)
If Not eWeld = WeldmentStateEnum.kPreparationsWeldmentState Then Exit Sub
Dim oOcc As ComponentOccurrence = oObj
MessageBox.Show(oOcc.Name, eWeld.ToString())

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 3

Nejc.Leban
Advocate
Advocate

That works great, thank you!

0 Likes