Reply

Create-in-place...?

[ Edited ]

 

Hi All,

I have a assembly with me. I want to create a part using create-in-place command through programming.

Any ideas?

 

Thanks in Advance

 

 

Posted by: Prasad Pawar
Post date: 11/15/2007 3:57:28 PM

5 REPLIES

RE: Create-in-place...?

[ Edited ]

 

Parsad,

You can use my Solid Edge Spy application to find the CommandID.  In C++, it would look something like this.m_pApplication->StartCommand(SolidEdgeFramework:Smiley FrustratedolidEdgeCommandConstants)32770)

Normally you don't want to hard code the CommandID but in this case there is not a constant defined for this command.

 

Posted by: Jason Newell
Post date: 11/18/2007 8:43:34 PM

RE: Create-in-place...?

[ Edited ]

 

Jason,

In help>programming with solid edge, it is given:

Syntax

Private Sub object_OnCreateInPlacePartUI(Filename, AppendToTitle, Template)

I am not getting any idea how to use it. Is it possible for you to give some code snippet of it?

I want to handle this on a button click event.

Thanks in advance

 

Posted by: Prasad Pawar
Post date: 11/19/2007 3:50:18 PM

RE: Create-in-place...?

[ Edited ]

Prasad,

 

What is your target programming lanugage and are you doing this in an addin or macro.

 

Posted by: Jason Newell
Post date: 11/19/2007 4:46:14 PM

RE: Create-in-place...?

[ Edited ]

Jason,

I am using Vb.net 2005 and SE V18. Doing this as a macro.

Thanks

 

Posted by: Prasad Pawar
Post date: 11/20/2007 3:35:38 PM

RE: Create-in-place...?

[ Edited ]

Imports System.Runtime.InteropServicesPublic Class Form1 Private m_application As SolidEdgeFramework.Application Private WithEvents m_FileUIEvents As SolidEdgeFramework.ISEFileUIEvents_Event Private WithEvents m_ApplicationEvents As SolidEdgeFramework.ISEApplicationEvents_Event Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load m_application = Marshal.GetActiveObject("SolidEdge.Application") m_ApplicationEvents = m_application.ApplicationEvents m_FileUIEvents = m_application.FileUIEvents End Sub Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing FreeComObjects() End Sub Private Sub m_ApplicationEvents_BeforeQuit() Handles m_ApplicationEvents.BeforeQuit FreeComObjects() End Sub Private Sub m_FileUIEvents_OnCreateInPlacePartUI(ByRef Filename As String, ByRef AppendToTitle As String, ByRef Template As String) Handles m_FileUIEvents.OnCreateInPlacePartUI ' Name of new part file. Filename = "C:\Hello.par" ' Not sure what good this is. AppendToTitle = "My Title" ' Full template path must be specified! Template = "C:\Program Files\Solid Edge V20\Template\Normal.par" ' Unremark the following line to let Solid Edge operate normally. 'Throw New NotImplementedException() End Sub Private Sub FreeComObjects() If Not (m_FileUIEvents Is Nothing) Then Marshal.ReleaseComObject(m_FileUIEvents) End If If Not (m_ApplicationEvents Is Nothing) Then Marshal.ReleaseComObject(m_ApplicationEvents) End If If Not (m_application Is Nothing) Then Marshal.ReleaseComObject(m_application) End If End SubEnd Class

 

Posted by: Jason Newell
Post date: 11/25/2007 5:43:41 PM