tag:blogger.com,1999:blog-8906496349625416125.post4303831114631348432..comments2023-06-26T15:24:56.740+05:30Comments on Surf and Code: Making of Zoom To Selection Part2Tushar Suradkarhttp://www.blogger.com/profile/14340364758751714823noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-8906496349625416125.post-14956244599355685082021-09-16T20:29:22.172+05:302021-09-16T20:29:22.172+05:30I have a draft open in SE which I try to zoom.
F...I have a draft open in SE which I try to zoom. <br /><br />First, I've put it in a public sub, since I want to integrate it in an app which is doing other things.<br /><br />I have declare all the variables in the Public Class. I've changed oDoc to oDraft because oDoc is already used elsewhere<br /><br />Public Class Form1<br /> Dim oApp As SolidEdgeFramework.Application = Nothing<br /> Dim oDraft As SolidEdgeDraft.DraftDocument = Nothing<br /> Dim oSheet As SolidEdgeDraft.Sheet = Nothing<br /> Dim oSheetWindow As SolidEdgeDraft.SheetWindow = Nothing<br /> Dim XMin As Double = 0, YMin As Double = 0<br /> Dim XMax As Double = 0, YMax As Double = 0<br /> Dim XWin1 As Double = 0, YWin1 As Double = 0<br /> Dim XWin2 As Double = 0, YWin2 As Double = 0<br /> Dim X1 As Double = 0, Y1 As Double = 0<br /> Dim X2 As Double = 0, Y2 As Double = 0<br /> Dim sCaption As String = "Zoom to Selection"<br /> Dim Rangecoords As List(Of Double) = New List(Of Double)<br /> Dim LLx As Double = 0<br /> Dim LLy As Double = 0<br /> Dim URx As Double = 0<br /> Dim URy As Double = 0<br />' Then my Private Sub is coming<br /> Private Sub Zoom to sheet()<br /> oApp = Marshal.GetActiveObject("SolidEdge.Application")<br /> oDraft = oApp.ActiveDocument<br /><br /> oSheet = oDraft.ActiveSheet<br /> Dim oSel As SelectSet = Nothing<br /> oSel = oDraft.SelectSet<br /> If oSel.Count = 0 Then<br /> MessageBox.Show("Nothing selected")<br /> End If<br /> GetseedRange(oSel, Rangecoords)<br /> End Sub<br />Louis-Simon Falardeauhttps://www.blogger.com/profile/11220409833198474366noreply@blogger.comtag:blogger.com,1999:blog-8906496349625416125.post-56399965097039901372021-09-16T11:00:40.618+05:302021-09-16T11:00:40.618+05:30Please share your code, what you have written so f...Please share your code, what you have written so far.<br />Also, I believe you have selected something in Solid Edge to zoom to.<br />Tushar.Suradkarhttps://www.blogger.com/profile/10557702058128323511noreply@blogger.comtag:blogger.com,1999:blog-8906496349625416125.post-14330304109036206872021-09-16T07:30:43.612+05:302021-09-16T07:30:43.612+05:30Hello, I'm trying to reproduce this. But I alw...Hello, I'm trying to reproduce this. But I always get the message ''nothing selected''. I'm stuck pretty at the beginning. Of course program cannot work like thatLouis-Simon Falardeauhttps://www.blogger.com/profile/11220409833198474366noreply@blogger.com