pasobct.blogg.se

Vb net 2010 console application get startuppath
Vb net 2010 console application get startuppath








  1. Vb net 2010 console application get startuppath how to#
  2. Vb net 2010 console application get startuppath code#

Vb net 2010 console application get startuppath how to#

You will see in a subsequent blog post how to invoke a standard Windows file dialog or Solid Edge file dialog that allows user to specify a location and filename for saving a file. You can also directly specify a hard-coded path as “D:\\Temp\\Part1.par” though its not a recommended practice. To this is appended the filename with an extension. The SaveAs function takes a string which can be build from two parts:Īpplication.StartupPath which is the location of the Debug or Release folder or the path where ever the exe for this project is kept. ODoc.SaveAs( Application.StartupPath + \\Part1.par) To directly specify a location and file name for saving the document, double click the Save Document As button and enter: This invokes the Solid Edge Save File dialog where you can specify a location and file name. Since oDocs is same as oApp.Documents as assigned in the form’s load event.įor the Save Document button, simply add: ODoc = oDocs.Add( "SolidEdge.PartDocument") ODoc = ( " SolidEdge.SheetMetalDocument" ) Similarly other type of documents can be created by changing the ProGID as below: This adds a new Part document to the documents collection and is immediately displayed to the screen giving the impression of creating a new document.

Vb net 2010 console application get startuppath code#

The line oApp.DisplayAlerts = False suppresses the display of any alert messages or prompts from Solid Edge that may appear during the execution of the program.īuild the project and check if everything is fine.īack to Visual Studio, double click the Create New Document button and add the following line of code for the button: Similarly the oDoc variable is capable of storing any Solid Edge document type viz.

vb net 2010 console application get startuppath

At the time of the form loading, if no documents are open, the documents collection still exits and has count of 0. The oDocs variable stores the documents collection of Solid Edge. If you click the LocalServer32 just above ProgID folder in the left panel, it displays the installed path for Solid Edge. After a while it searches for SolidEdge.Application and displays the search as below: In the registry editor application which looks like the Windows Explorer, select Edit > Find or press F3 and type SolidEdge.Application. To check this, start the Registry Editor by pressing Windows+R button to invoke the Run utility. Here, SolidEdge.Application is the Program ID for Solid Edge which does not change from version to version. The GetActiveObject method of the Marshal class helps to connect to a running instance of Solid Edge, which in turn is made available by virtue of the OApp = Marshal.GetActiveObject( "SolidEdge.Application") In the form’s load event add the following code: SolidEdgeDocumentĭim oDocs As SolidEdgeFramework. Applicationĭim oDoc As SolidEdgeFramework. Inside the Form1 class, add a variable oApp for Solid Edge, oDoc for the documents collection and oDoc for a Solid Edge Document.ĭim oApp As SolidEdgeFramework. View the code for the form and at the top add the following: Select Solid Edge Framework Type Library from the list.Īdd buttons and a listbox to the form as shown. In the dialog that appears take the COM tab.

vb net 2010 console application get startuppath

In the Solution Explorer, click the Show All Files button and right click References folder in the tree beneath and select Add Reference. Specify a suitable name for the project and a location and click OK. Net framework 4 should work well with Solid Edge 20. Start Visual Studio and add a Windows Forms Application project.

vb net 2010 console application get startuppath

  • Activate a desired document from among open documents.
  • vb net 2010 console application get startuppath

  • Export a document to other CAD formats.
  • Save As a document with different name.
  • In this tutorial you learn using VB.Net, how to:










    Vb net 2010 console application get startuppath