I found your post looking for a way to find out if a view was selected in my draft document, in this post you uploaded a macro that adds a callout showing the configuration name of the selected view, do you think you could help me by telling me which object did you use to get the view status?
this the link where I found your macro
Here's the module that handles the meaty part of the macro.
Would you be able to figure out what you seek ?
If not please let me know which part of the code you want to understand.
I'd be glad to help.
Imports System.Runtime.InteropServices Imports System.Windows.Forms Module Module1 Dim oView As SolidEdgeDraft.DrawingView = Nothing Dim sCaption As String = "Config Callout" Dim oSheet As SolidEdgeDraft.Sheet = Nothing Sub Main() Dim oApp As SolidEdgeFramework.Application = Marshal.GetActiveObject("SolidEdge.Application") If oApp Is Nothing Then MessageBox.Show("Solid Edge Should be running.", sCaption, MessageBoxButtons.OK, MessageBoxIcon.Error) End End If If oApp.ActiveDocumentType <> SolidEdgeFramework.DocumentTypeConstants.igDraftDocument Then MessageBox.Show("A Draft document should be open.", sCaption, MessageBoxButtons.OK, MessageBoxIcon.Information) End End If Dim oDoc As SolidEdgeDraft.DraftDocument = oApp.ActiveDocument oSheet = oDoc.ActiveSheet Dim oSet As SolidEdgeFramework.SelectSet = oDoc.SelectSet If oSet.Count <> 1 Then MessageBox.Show("A single drawing view should be selected.", sCaption, MessageBoxButtons.OK, MessageBoxIcon.Information) End End If If Not TypeOf (oSet.Item(1)) Is SolidEdgeDraft.DrawingView Then MessageBox.Show("A single drawing view should be selected.", sCaption, MessageBoxButtons.OK, MessageBoxIcon.Information) End End If oView = oSet.Item(1) If oView.Configuration = String.Empty Then If MessageBox.Show("Configuration name for this view is <empty>." + vbCrLf + vbCrLf + "Add balloon ?", sCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then AddBalloon() End If Else AddBalloon() End If End Sub Private Sub AddBalloon() Dim dXMin As Double = 0, dYMin As Double = 0, dXMax As Double = 0, dYMax As Double = 0 Dim dXCen As Double = 0, dYCen As Double = 0 oView.Range(dXMin, dYMin, dXMax, dYMax) Dim oBalloons As SolidEdgeFrameworkSupport.Balloons = oSheet.Balloons Dim oBall As SolidEdgeFrameworkSupport.Balloon = Nothing oBall = oBalloons.Add(dXMax, dYMax, 0) oBall.BalloonText = oView.Configuration If MessageBox.Show("Add leader to balloon ?" + vbCrLf + vbCrLf + "Free macro by:" + vbCrLf + "www.CADVertex.com", sCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then oBall.Leader = True End If End Sub End Module
Is this related to your other post for gathering view info and writing to title block?
Tell me your requirements, I can help you with it.
I'm tryin to migrate your code into VBA (im a beginner by the way), I was able to view and manipulate some labels and callouts in my Solid Edge Drawing but I couldn't get the view coordinates to add a new item, could you explaind me how to use the "range" function in VBA? you may want to take a look at my code and see how lost I am hehe
What problem are you facing with using the Range function ?
Note that it should be preceeded by Call when used in VBA:
Call objSEdgeView.Range dXMin, dYMin, dXMax, dYMax
and also note - no (brackets) since the function does not return a value.
dXMain,... etc will be assigned values after the function call since they are ByRef arguments
What else do you want to know ?
Also, use the Insert Code option instead of attaching files: