Associated Snapshot of Drawing view

Associated Snapshot of Drawing view

tobias_wiesendanger
Advocate Advocate
306 Views
4 Replies
Message 1 of 5

Associated Snapshot of Drawing view

tobias_wiesendanger
Advocate
Advocate

Did anyone try to access the snapshot of a view? In my case there is just one drawing view placed on the first sheet and I need to get the exact associated modelstate properties. For normal views this is pretty easy because you can read the active modelstate property. This is empty in this case as described in the help file. 

 

I thought it should be possible to get the associated snapshot and check what modelstate is used for this scene, but so far did not find a solution.

 

regards

 

Tobias

0 Likes
307 Views
4 Replies
Replies (4)
Message 2 of 5

m_baczewski
Advocate
Advocate

Hello,

 

I'm not entirely sure if this is what you meant, but here is some code that will display the name of the current model state for the drawing.

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet

Dim drawView As DrawingView = oSheet.DrawingViews.Item(1)
MsgBox(drawView.ActiveModelState)
0 Likes
Message 3 of 5

tobias_wiesendanger
Advocate
Advocate

Hi,

 

Thanks for your answer. I know about this, but ActiveModelState is empty if this drawingview is referencing a presentation document. Which is as by design if we can trust the help file. So this sadly wont work in my case.

0 Likes
Message 4 of 5

m_baczewski
Advocate
Advocate

Okey i see now. Try to use this.

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet

Dim drawView As DrawingView = oSheet.DrawingViews.Item(1)
Dim refDocDescriptors As DocumentDescriptorsEnumerator = drawView.ReferencedDocumentDescriptor.ReferencedDocument.ReferencedDocumentDescriptors
Dim redDoc As Document = refDocDescriptors.Item(1).ReferencedDocument


MsgBox(redDoc.ComponentDefinition.ModelStates.ActiveModelState.Name)
0 Likes
Message 5 of 5

tobias_wiesendanger
Advocate
Advocate

This is not related to the drawing. This way you will get the activeModelstate of the referenced document, but that has nothing to do with the drawing view.

0 Likes