Active view of 'drawInView' command

 

Hello Julian,

Thanks for code. I tried the code above.But when user is in the 'draftviewEdit' environment by 'DrawInView' command in popup.

How can I find which view is active/edited? How can I get object of view the user edited? There is no such property/method to find activeView or EditedView.

Can anybody help me?

Thanks,

Madhav

 

Posted by: madhav dhamale
Post date: 6/28/2009 8:14:45 PM

1 REPLY

RE: Active view of 'drawInView' command

Dim oSE As SolidEdgeFramework.Application

Dim oDFT As SolidEdgeDraft.DraftDocument

Dim oSheet As Sheet

Dim oDvW As DrawingView

Dim sheetname As String

 

Set oSE = GetObject(, "solidedge.application")

 

Set oDFT = oSE.ActiveDocument

 

'The example must be run with a drawing view open "drawinview". If you cannot get this before the user closes the drawing view this will not work.

'So sheetname is the internal name of the sheet inside the drawing view.

sheetname = oDFT.ActiveSheet.Name 'You must get this name before the user closes the view.

 

'Search for the drawing view object that contains that sheet.

'For each sheet in the working sheets...

For Each oSheet In oDFT.Sections.WorkingSection.Sheets

'Search in the drawing views...

For Each dvw In oSheet.DrawingViews

If sheetname = dvw.Sheet.Name Then

'I found the sheet, so i have the drawing view.

Set myDrawingView = dvw

Exit For

End If

Next

Next

 

 

Posted by: Julian Guillo
Post date: 7/7/2009 8:14:51 AM