Files
pdm/documentation/api_extracted/EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable5~SetVar.html

191 lines
14 KiB
HTML

<html xmlns:mshelp="http://msdn.microsoft.com/mshelp">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<meta content="history" name="save">
<meta content="Innovasys Document! X (http://www.innovasys.com)" name="GENERATOR">
<title>SetVar Method (IEdmEnumeratorVariable5)</title>
<link href="stylesheets/dotnet2005.css" type="text/css" rel="stylesheet">
<script src="script/dotnet2005.js" type="text/javascript">
</script><xml>
<MSHelp:Keyword Index="F" Term="EPDM.Interop.epdm.IEdmEnumeratorVariable5.SetVar" />
<MSHelp:Attr Name="DevLang" Value="CSharp" />
<MSHelp:Attr Name="DevLang" Value="VB" />
<MSHelp:Attr Name="DevLang" Value="JScript" />
<MSHelp:Attr Name="TopicType" Value="kbSyntax"/>
<MSHelp:Attr Name="LinkGroup" Value="Help"/>
<MSHelp:Attr Name="Locale" Value="kbEnglish"/>
<MSHelp:Attr Name="HelpPriority" Value="1"/>
</xml>
<script src="script/hs-expandcollapse.js" type="text/javascript"></script>
<script src="script/hs-enlargeimage.js" type="text/javascript"></script>
<script src="script/swfobject.js" type="text/javascript"></script>
<script src="script/hs-common.js" type="text/javascript"></script>
<script src="script/hs-heading-expandcollapse.js" type="text/javascript"></script>
<script src="script/hs-tabstrip.js" type="text/javascript"></script>
</head>
<body id="dxBody" topmargin="0">
<form>
<input class="userDataStyle" id="userDataCache" type="hidden" name="userDataCache"> <input id="hiddenScrollOffset" type="hidden" name=
"hiddenScrollOffset"> <img id="collapseImage" style="DISPLAY: none; WIDTH: 0px; HEIGHT: 0px" src="dotnetimages/collapse.gif"> <img id="expandImage"
style="DISPLAY: none; WIDTH: 0px; HEIGHT: 0px" src="dotnetimages/expand.gif"> <img id="collapseAllImage" style="DISPLAY: none; WIDTH: 0px; HEIGHT: 0px"
src="dotnetimages/collapse.gif"> <img id="expandAllImage" style="DISPLAY: none; WIDTH: 0px; HEIGHT: 0px" src="dotnetimages/expand.gif"> <img id=
"dropDownImage" style="DISPLAY: none; WIDTH: 0px; HEIGHT: 0px" src="dotnetimages/drpdown.gif"> <img id="dropDownHoverImage" style=
"DISPLAY: none; WIDTH: 0px; HEIGHT: 0px" src="dotnetimages/drpdown_orange.gif"> <img id="copyImage" style="DISPLAY: none; WIDTH: 0px; HEIGHT: 0px" src=
"dotnetimages/copycode.gif"> <img id="copyHoverImage" style="DISPLAY: none; WIDTH: 0px; HEIGHT: 0px" src="dotnetimages/copycodeHighlight.gif">
</form>
<div id="pagetop">
<table id="pagetoptable1" width="100%">
<tbody>
<tr id="pagetoptable1row1">
<td align="left"><span id="projecttitle">SOLIDWORKS PDM Professional API Help</span></td>
<td align="right"><span id="feedbacklink"><a href="mailto:apihelp.feedback@3ds.com?subject=Documentation Feedback: EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable5~SetVar.html">Send Feedback</a></span></td>
</tr>
<tr id="pagetoptable1row2">
<td align="left" colspan="2"><span id="pagetitle">SetVar Method (IEdmEnumeratorVariable5)</span></td>
</tr>
<tr id="pagetoptable1row3">
<td colspan="2"><a onclick="javascript:openSectionById('seeAlsoSectionHeader');" href="#seealsobookmark">
See Also</a>&nbsp;
<a href="#ExampleBookmark" onclick="javascript:openSectionById('exampleSectionHeader');">Example</a></td>
</tr>
</tbody>
</table>
<table id="pagetoptable2" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><span id="toggleExpandedAll"><img class="toggleAll" id="toggleExpandedAllImage" src="dotnetimages/collapse.gif"> <label id=
"collapseAllLabel" style="DISPLAY: none" for="toggleExpandedAllImage">Collapse All</label> <label id="expandAllLabel" style="DISPLAY: none" for="toggleExpandedAllImage">
Expand All</label></span> <span id="languageFilterToolTip"
onmouseover='document.getElementById("languageFilterImage").src=document.getElementById("dropDownHoverImage").src;' style="CURSOR: default"
onfocusout='document.getElementById("languageFilterImage").src=document.getElementById("dropDownImage").src;' onclick=
"showBox('dxlanguagemenu',event,document.getElementById('languageFilterImage'))" onfocusin=
'document.getElementById("languageFilterImage").src=document.getElementById("dropDownHoverImage").src;' onmouseout=
'document.getElementById("languageFilterImage").src=document.getElementById("dropDownImage").src;'><img id="languageFilterImage" src=
"dotnetimages/drpdown.gif"> <label id="showAllLabel" style="DISPLAY: none" for="languageFilterImage">
Language Filter: All</label> <label id="multipleLabel" style=
"DISPLAY: none" for="languageFilterImage">Language Filter: Multiple</label>
<label id="VBLabel" for="languageFilterImage" style="display: none;">Language Filter: Visual Basic</label>
<label id="CSLabel" for="languageFilterImage" style="display: none;">Language Filter: C#</label>
<label id="CPP2005Label" for="languageFilterImage" style="display: none;">Language Filter: C++/CLI</label>
</span></td>
</tr>
</tbody>
</table><table width="100%" id="pagetopbreadcrumbs" cellspacing="0" cellpadding="0"><tr><td>
<a href="EPDM.Interop.epdm~EPDM.Interop.epdm_namespace.html">EPDM.Interop.epdm Namespace</a>
> <a href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable5.html">IEdmEnumeratorVariable5 Interface</a>
: SetVar Method (IEdmEnumeratorVariable5)</td></tr></table>
<div class="dxpopupbubble" id="dxlanguagemenu">
<input id="VBCheckbox" type="checkbox" name="languageFilter" onClick="setLanguage(this)" />
<label class="languageFilter" for="VBCheckbox">
Visual Basic
</label>
<br /><input id="CSCheckbox" type="checkbox" name="languageFilter" onClick="setLanguage(this)" />
<label class="languageFilter" for="CSCheckbox">
C#
</label>
<br /><input id="CPP2005Checkbox" type="checkbox" name="languageFilter" onClick="setLanguage(this)" />
<label class="languageFilter" for="CPP2005Checkbox">
C++/CLI
</label>
</div>
<div id="bsVarName_box" class="dxpopupbubble">
<DL><DT class="popupbubble"><I>bsVarName</I></DT>
<DD class="popupbubble">Name of variable to write</DD></DL>
</div>
<div id="bsCfgName_box" class="dxpopupbubble">
<DL><DT class="popupbubble"><I>bsCfgName</I></DT>
<DD class="popupbubble">Name of configuration or layout to which to store the variable value; empty string for folders and file types that do not support configurations</DD></DL>
</div>
<div id="poValue_box" class="dxpopupbubble">
<DL><DT class="popupbubble"><I>poValue</I></DT>
<DD class="popupbubble">Variable value</DD></DL>
</div>
<div id="bOnlyIfPartOfCard_box" class="dxpopupbubble">
<DL><DT class="popupbubble"><I>bOnlyIfPartOfCard</I></DT>
<DD class="popupbubble">True to store the variable only if it is part of the file or folder data card, false to store the variable as hidden data if it is not part of the file or folder data card</DD></DL>
</div>
</div>
<div id="pagebody" valign="bottom">
<a name="topBookmark"></a>
<div id="mainbody">
<div class="saveHistory" id="allHistory" onsave="saveAll()" onload="loadAll()"></div>
Sets the value of the specified variable in this file or folder.
<h1 class="heading"><span class="expandcollapse" tabindex="0"><img id="syntaxToggle" class="toggle" name="toggleSwitch" src="dotnetimages/collapse.gif"></img>Syntax</span></h1><div id="syntaxSection" class="section" name="collapseableSection"><DIV class=LanguageSpecific id=Syntax_VB><table class="syntaxtable" width="100%" cellpadding="0" cellspacing="0"><tr><th>Visual Basic</th><th>&nbsp;</th></tr><tr><td colspan="2"><pre>Sub SetVar( _
&nbsp;&nbsp;&nbsp;ByVal <i><a class="parameter" id="bsVarName" href="#" onclick="javascript:showParamBox(event);">bsVarName</a></i> As System.String, _
&nbsp;&nbsp;&nbsp;ByVal <i><a class="parameter" id="bsCfgName" href="#" onclick="javascript:showParamBox(event);">bsCfgName</a></i> As System.String, _
&nbsp;&nbsp;&nbsp;ByRef <i><a class="parameter" id="poValue" href="#" onclick="javascript:showParamBox(event);">poValue</a></i> As System.Object, _
&nbsp;&nbsp;&nbsp;Optional ByVal <i><a class="parameter" id="bOnlyIfPartOfCard" href="#" onclick="javascript:showParamBox(event);">bOnlyIfPartOfCard</a></i> As System.Boolean _
) </pre></tr></table></div>
<DIV class=LanguageSpecific id=Syntax_CS><table class="syntaxtable" width="100%" cellpadding="0" cellspacing="0"><tr><th>C#</th><th>&nbsp;</th></tr><tr><td colspan="2"><pre>void SetVar(
&nbsp;&nbsp;&nbsp;System.string <i><a class="parameter" id="bsVarName" href="#" onclick="javascript:showParamBox(event);">bsVarName</a></i>,
&nbsp;&nbsp;&nbsp;System.string <i><a class="parameter" id="bsCfgName" href="#" onclick="javascript:showParamBox(event);">bsCfgName</a></i>,
&nbsp;&nbsp;&nbsp;ref System.object <i><a class="parameter" id="poValue" href="#" onclick="javascript:showParamBox(event);">poValue</a></i>,
&nbsp;&nbsp;&nbsp;System.bool <i><a class="parameter" id="bOnlyIfPartOfCard" href="#" onclick="javascript:showParamBox(event);">bOnlyIfPartOfCard</a></i>
)</pre></tr></table></div>
<DIV class=LanguageSpecific id=Syntax_CPP2005><table class="syntaxtable" width="100%" cellpadding="0" cellspacing="0"><tr><th>C++/CLI</th><th>&nbsp;</th></tr><tr><td colspan="2"><pre>void SetVar(
&&nbsp;&nbsp;&nbsp;System.String^ <i><a class="parameter" id="bsVarName" href="#" onclick="javascript:showParamBox(event);">bsVarName</a></i>,
&&nbsp;&nbsp;&nbsp;System.String^ <i><a class="parameter" id="bsCfgName" href="#" onclick="javascript:showParamBox(event);">bsCfgName</a></i>,
&&nbsp;&nbsp;&nbsp;System.Object^% <i><a class="parameter" id="poValue" href="#" onclick="javascript:showParamBox(event);">poValue</a></i>,
&&nbsp;&nbsp;&nbsp;System.bool <i><a class="parameter" id="bOnlyIfPartOfCard" href="#" onclick="javascript:showParamBox(event);">bOnlyIfPartOfCard</a></i>
) </pre></tr></table></div>
<h4 class=dxh4>Parameters</h4><DL><DT><I>bsVarName</I></DT>
<DD>Name of variable to write</DD><DT><I>bsCfgName</I></DT>
<DD>Name of configuration or layout to which to store the variable value; empty string for folders and file types that do not support configurations</DD><DT><I>poValue</I></DT>
<DD>Variable value</DD><DT><I>bOnlyIfPartOfCard</I></DT>
<DD>True to store the variable only if it is part of the file or folder data card, false to store the variable as hidden data if it is not part of the file or folder data card</DD></DL>
</div>
<a name="exampleBookmark"></a>
<h1 class="heading"><span class="expandcollapse" tabindex="0"><img id="exampleToggle" class="toggle" name="toggleSwitch" src="dotnetimages/collapse.gif"></img>Example</span></h1><div id="exampleSection" class="section" name="collapseableSection"><a href="Change_Card_Variables_Addin_Example_CSharp.htm">Change Card Variables Add-in (C#)</a>
<br/><a href="Change_Card_Variables_Addin_Example_VBNET.htm">Change Card Variables Add-in (VB.NET)</a>
<br/><a href="Set_Part_Number_Using_Default_Serial_Numbers_Example_CSharp.htm">Set Part Number Using Default Serial Numbers (C#)</a>
<br/><a href="Set_Part_Number_Using_Default_Serial_Numbers_Example_VBNET.htm">Set Part Number Using Default Serial Numbers (VB.NET)</a>
</div>
<h1 class="heading"><span class="expandcollapse" tabindex="0"><img id="remarksToggle" class="toggle" name="toggleSwitch" src="dotnetimages/collapse.gif"></img>Remarks</span></h1><div id="remarksSection" class="section" name="collapseableSection"><P>To specify bsCfgName:</P>
<UL>
<LI>Call <A href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmFile5~GetConfigurations.html">IEdmFile5::GetConfigurations</A> to get the available configuration names for this file.
<LI>If this method is used in your add-in's implementation of <A href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmAddIn5~OnCmd.html">IEdmAddIn5::OnCmd</A>, then a list of configuration names for the data card is returned in ppoData that can be cast to <A href="EPDM.Interop.epdm~EPDM.Interop.epdm.EdmCmdData.html">EdmCmdData</A>. EdmCmdData.mpoExtra contains an&nbsp;<A href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmStrLst5.html">IEdmStrLst5</A> of configuration names.</LI></UL>
<P>After calling this method to update the variables that can be updated, you must call&nbsp;<A href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable5~Flush.html">IEdmEnumeratorVariable5::Flush</A> or&nbsp;<A href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable8~CloseFile.html">IEdmEnumeratorVariable8::CloseFile</A> with the bFlush argument set to true in order to ensure that the changes are saved properly to the file or folder.</P>
<P><A href="ReturnCodes.htm">Return codes</A>:</P>
<UL>
<LI>S_OK: The method successfully executed.
<LI>S_FALSE: The variable was not found, and bOnlyIfPartOfCard is true.
<LI>E_EDM_FILE_NOT_LOCKED_BY_YOU: The file is not checked out.</LI></UL></div>&nbsp;
<a name="seealsobookmark"></a>
<h1 class="heading"><span class="expandcollapse" tabindex="0"><img id="seealsoToggle" class="toggle" name="toggleSwitch" src="dotnetimages/collapse.gif"></img>See Also</span></h1><div id="seealsoSection" class="section" name="collapseableSection"><h4 class="dxh4"></h4><a href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable5.html">IEdmEnumeratorVariable5 Interface</a>
<br/><a href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable5_members.html">IEdmEnumeratorVariable5 Members</a>
<br/><a href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable10~GetVar2.html">IEdmEnumeratorVariable10::GetVar2 Method ()</a>
<br/><a href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmEnumeratorVariable10~GetVarAsText.html">IEdmEnumeratorVariable10::GetVarAsText Method ()</a>
</p>
</div>
<h1 class="heading"><span class="expandcollapse" tabindex="0"><img id="availabilityToggle" class="toggle" name="toggleSwitch" src="dotnetimages/collapse.gif"></img>Availability</span></h1><div id="availabilitySection" class="section" name="collapseableSection">SOLIDWORKS PDM Professional Version 5.2</div>
</div>
<div id="pagefooter"></div>
</div>
</body>
</html>