how to get view from draft document

Creator
Creator

Hello!

 

I have problem - I don't understand how to get view from draft document to use components. For example, I have draft document of assembly. I need to get components of this assembly, which showed on draft document.

2 REPLIES

Re: how to get view from draft document

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

You can use Spy for Solid Edge to access to the description of what you have in your draft document (thanks Jason) .

 

You can access to the component of an assembly in your draft for the draft Document or the drawing view.

From draft document : ActiveDocument.ModelLinks.Item(1)

Item number depending of how many file are present in the draft document.

Spy for SE


Romuald BERTIN

Re: how to get view from draft document

Phenom
Phenom

Hello tucha_te, rbertin has shown you the right direction with getting the model links to the assembly model of the view.

 

To answer your question as in "- I don't understand how to get view from draft document...",

the following lines will step wise take you to the assembly ocurrences beginning with the view in the Draft sheet:

 

Dim oApp As SolidEdgeFramework.Application = Marshal.GetActiveObject("SolidEdge.Application")

 

Dim oDoc As SolidEdgeDraft.DraftDocument = oApp.ActiveDocument
Dim oSheet As SolidEdgeDraft.Sheet = oDoc.ActiveSheet

Dim oView As DrawingView = oSheet.DrawingViews.Item(1)
Dim oModelLink As ModelLink = oView.ModelLink
Dim sAssemblyName = oModelLink.FileName

Dim oAsmDoc As AssemblyDocument = oApp.Documents.Open(sAssemblyName)
Dim oOccurrences As Occurrences = oAsmDoc.Occurrences

 

BR,

Tushar Suradkar

http://surfandcode.blogspot.in