{"id":6878,"date":"2014-07-27T03:11:26","date_gmt":"2014-07-27T10:11:26","guid":{"rendered":"https:\/\/blogs.plm.automation.siemens.com\/t5\/Solid-Edge-Blog\/Automation-Part-Configurator-3\/ba-p\/263249"},"modified":"2026-03-26T07:30:22","modified_gmt":"2026-03-26T11:30:22","slug":"automation-part-configurator-3","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/solidedge\/automation-part-configurator-3\/","title":{"rendered":"Automation: Part Configurator 3"},"content":{"rendered":"<p><P class=\"lia-message-subject\">This is the sixth post in the Automation series and the third article for Part Configurator.<\/P><P class=\"lia-message-subject\">In retrospect:<\/P><P class=\"lia-message-subject\">&nbsp;<\/P><P><a target=\"_blank\" href=\"https:\/\/blogs.plm.automation.siemens.com\/t5\/Solid-Edge-Blog\/Take-the-First-Steps-to-Automation\/ba-p\/32478\" rel=\"noopener noreferrer\">Take the First Steps to Automation<\/A><\/P><P><STRONG>Takeaway<\/STRONG>:<STRONG> \u2022<\/STRONG> Getting started <STRONG>\u2022<\/STRONG> Adding references<STRONG> \u2022<\/STRONG> Console application.<\/P><P><a target=\"_blank\" href=\"https:\/\/blogs.plm.automation.siemens.com\/t5\/Solid-Edge-Blog\/First-Steps-to-Automation-Part-2\/ba-p\/32496\" rel=\"noopener noreferrer\">First Steps to Automation &#8211; Part 2<\/A><\/P><P><STRONG>Takeaway<\/STRONG>:<STRONG> \u2022<\/STRONG> Active Document <STRONG>\u2022<\/STRONG> selection Set<STRONG> \u2022<\/STRONG> Ribbon Customization.<\/P><P><a target=\"_blank\" href=\"https:\/\/blogs.plm.automation.siemens.com\/t5\/Solid-Edge-Blog\/Automation-Parametric-Parts\/ba-p\/36482\" rel=\"noopener noreferrer\">Automation &#8211; Parametric Parts<\/A><\/P><P><STRONG>Takeaway<\/STRONG>:<STRONG> \u2022<\/STRONG> Windows application <STRONG>\u2022<\/STRONG> Part features <STRONG>\u2022<\/STRONG> Variable Table.<\/P><P><a target=\"_blank\" href=\"https:\/\/blogs.plm.automation.siemens.com\/t5\/Solid-Edge-Blog\/Automation-Part-Configurator\/ba-p\/37112\" rel=\"noopener noreferrer\">Automation: Part Configurator<\/A><\/P><P><STRONG>Takeaway<\/STRONG>:<STRONG> \u2022<\/STRONG> ListBoxes <STRONG>\u2022<\/STRONG> Suppression Variables.<\/P><P><a target=\"_blank\" href=\"https:\/\/blogs.plm.automation.siemens.com\/t5\/Solid-Edge-Blog\/Automation-Part-Configurator-2\/ba-p\/37827\" rel=\"noopener noreferrer\">Automation: Part Configurator 2<\/A><\/P><P><STRONG>Takeaway<\/STRONG>:<STRONG> \u2022<\/STRONG> File Dialogs<STRONG> \u2022<\/STRONG> Select Case<STRONG>.<\/STRONG><\/P><P>A nice feature to add to the file save dialog would be to provide a default file name depending upon the configuration selected. Solid Edge does this when saving a new file by suggesting a default file name like Part1.par, asm2.asm, etc.<\/P><P>To do this, add the line in bold as shown below for the Save Part button:<\/P><PRE>saveDialog.Title = &#8220;Save Part Configuration As&#8230;&#8221;<br \/>\nsaveDialog.Filter = &#8220;Save Part Configuration|*.par&#8221;<\/p>\n<p><STRONG>saveDialog.FileName = lstShaft.SelectedItem.ToString + &#8221; 1&#8243;<\/STRONG><\/p>\n<p>saveDialog.ShowDialog()<\/PRE><P>This simply means, take the text of the selected item in the listbox and add 1 to it and use it as the default file name to save the configuration.<\/P><P><IMG src=\"https:\/\/siemensplm.i.lithium.com\/t5\/image\/serverpage\/image-id\/7349i2AEAE0612F3B7C31\/image-size\/original?v=mpbl-1&amp;px=-1\" title=\"01.png\" alt=\"01.png\" border=\"0\" align=\"right\" \/><\/P><P>So when the <EM>Shaft with Hole<\/EM> configuration is picked, the default file name would appear as shown besides.<\/P><P>Using the + sign to add strings is a powerful feature of VB.Net. Invest some time in exploring strings in VB.Net at this <a target=\"_blank\" href=\"http:\/\/www.dotnetperls.com\/string-vbnet\" rel=\"nofollow noopener noreferrer\">suggested site<\/A>. This knowledge will come in handy in many situations while automating Solid Edge.<\/P><P>The file dialog used here is a VB.Net feature. Solid Edge provides its own flavour of the File Save dialog which can be accessed using the GetSaveAsFileName function of the application object. Thus it can be accessed as below:<\/P><PRE>sConfigFileName = oApp.GetSaveAsFileName(LinksUpdateOption.igNoLinksUpdate, 1, lstShaft.SelectedItem.ToString + &#8221; 1&#8243;, &#8220;default_par&#8221;, 1, &#8220;Save Configuration As&#8230;&#8221;, False)<\/PRE><P>Open the Solid Edge installation folder and in the SDK folder open the&nbsp;sesdk.chm help file.<\/P><P>On the search tab, type in <EM>GetSaveAsFileName<\/EM> and click List Topics.<\/P><P>In the Select topic: list, double-click <EM>GetSaveAsFileName<\/EM>. The SE API documentation has detailed information on the various arguments and also a sample program on the usage of this method, hence it won&#8217;t be discussed here again.<\/P><P>These were the two items in the TODO list from previous post.<\/P><P>In the next part of the Automation series:<\/P><P>1. Revisit parametric parts and how to parametrically control parts from within an assembly using peer variables via VB.Net code.<\/P><P>2. Read in current values of variables so the user can tweak them from the current value &#8211; this is in response to a question on the <a target=\"_blank\" href=\"https:\/\/blogs.plm.automation.siemens.com\/t5\/Solid-Edge-Developer-Forum\/bd-p\/SEDeveloperForum\" rel=\"noopener noreferrer\">Solid Edge DEV forum<\/A>.<\/P><P>Meanwhile do <a target=\"_blank\" href=\"https:\/\/blogs.plm.automation.siemens.com\/t5\/forums\/postpage\/board-id\/SEDeveloperForum\" rel=\"noopener noreferrer\">post a new message<\/A> for any issues you might face.<\/P><P>-Tushar Suradkar<\/P><P><a target=\"_blank\" href=\"http:\/\/surfandcode.blogspot.in\/2014\/01\/index-of-all-tutorials-on-this-solid.html\" rel=\"nofollow noopener noreferrer\">http:\/\/surfandcode.blogspot.in<\/A><\/P><P><a target=\"_blank\" href=\"http:\/\/www.cadvertex.com\" rel=\"nofollow noopener noreferrer\">www.cadvertex.com<\/A><\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the sixth post in the Automation series and the third article for Part Configurator.  In retrospect:   Take the First Steps to Automation  Takeaway: \u2022 Getting started \u2022 Adding referenc&#8230;<\/p>\n","protected":false},"author":42979,"featured_media":6879,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1,96],"tags":[],"industry":[],"product":[],"coauthors":[],"class_list":["post-6878","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","category-tips-tricks"],"featured_image_url":"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/8\/2019\/09\/01-21.png","_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/posts\/6878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/users\/42979"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/comments?post=6878"}],"version-history":[{"count":2,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/posts\/6878\/revisions"}],"predecessor-version":[{"id":6881,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/posts\/6878\/revisions\/6881"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/media\/6879"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/media?parent=6878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/categories?post=6878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/tags?post=6878"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/industry?post=6878"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/product?post=6878"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/solidedge\/wp-json\/wp\/v2\/coauthors?post=6878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}