<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to change PART model with Excel VBA in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/How-to-change-PART-model-with-Excel-VBA/m-p/939033#M12954</link>
    <description>&lt;P&gt;1.&amp;nbsp;Define the dimension name of the PART model in uppercase English letters.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="그림1.png" style="width: 200px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100813i8369C1E5990ADF3E/image-size/small?v=v2&amp;amp;px=200" role="button" title="그림1.png" alt="그림1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;2.&amp;nbsp;program execution code&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[Please refer to the attached file for Excel VBA code.]&lt;BR /&gt;**********************************************************************************&lt;/P&gt;&lt;P&gt;Dim BaseSession As pfcls.IpfcBaseSession&lt;BR /&gt;Dim Session As IpfcSession&lt;BR /&gt;Dim model As pfcls.IpfcModel&lt;BR /&gt;Dim Solid As IpfcSolid&lt;BR /&gt;Dim ModelItemOwner As IpfcModelItemOwner&lt;BR /&gt;&lt;BR /&gt;'// Current Model Information&lt;BR /&gt;Set BaseSession = conn.Session&lt;BR /&gt;Set model = BaseSession.CurrentModel&lt;BR /&gt;Set Solid = model&lt;BR /&gt;Set ModelItemOwner = Solid&lt;BR /&gt;&lt;BR /&gt;*****&lt;BR /&gt;&lt;BR /&gt;'// SET Regenerate&lt;BR /&gt;Dim RegenInstructions As New CCpfcRegenInstructions&lt;BR /&gt;Dim Instrs As IpfcRegenInstructions&lt;BR /&gt;Set Instrs = RegenInstructions.Create(False, False, Nothing)&lt;BR /&gt;&lt;BR /&gt;Dim BaseDimension As IpfcBaseDimension&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim j As Long&lt;BR /&gt;&lt;BR /&gt;For j = 0 To rng.Count - 1&lt;BR /&gt;&lt;BR /&gt;Set BaseDimension = ModelItemOwner.GetItemByName(EpfcModelItemType.EpfcITEM_DIMENSION, Cells(j + 6, "B"))&lt;BR /&gt;&lt;BR /&gt;'//&amp;nbsp;Send entered dimension values to model&lt;BR /&gt;BaseDimension.DimValue = Cells(j + 6, "C")&lt;BR /&gt;&lt;BR /&gt;Next j&lt;BR /&gt;&lt;BR /&gt;'// Regenerate&lt;BR /&gt;Call Solid.Regenerate(Instrs)&lt;BR /&gt;Call Solid.Regenerate(Instrs)&lt;BR /&gt;&lt;BR /&gt;'// Window Repaint&lt;BR /&gt;Dim Window As pfcls.IpfcWindow&lt;BR /&gt;Set Window = BaseSession.CurrentWindow&lt;BR /&gt;&lt;BR /&gt;Window.Repaint&lt;BR /&gt;&lt;BR /&gt;conn.Disconnect (2)&lt;BR /&gt;*****************************************************&lt;BR /&gt;How to use the program&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1.&amp;nbsp;Change the name of a dimension in a model.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; . Example) ADD375 -&amp;gt; DOM01&lt;BR /&gt;&lt;BR /&gt;2.&amp;nbsp;Enter the name of the dimension in your model under Cells(6,B).&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .Three or more sizes are also possible.&lt;BR /&gt;&lt;BR /&gt;3. Click the GET button&lt;BR /&gt;&amp;nbsp; &amp;nbsp; . Retrieves dimension values from model&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4. Click the Change button&lt;BR /&gt;&amp;nbsp; &amp;nbsp; . Change the dimension value and click the change button&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2024 12:20:39 GMT</pubDate>
    <dc:creator>cko</dc:creator>
    <dc:date>2024-03-25T12:20:39Z</dc:date>
    <item>
      <title>How to change PART model with Excel VBA</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-change-PART-model-with-Excel-VBA/m-p/939033#M12954</link>
      <description>&lt;P&gt;1.&amp;nbsp;Define the dimension name of the PART model in uppercase English letters.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="그림1.png" style="width: 200px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100813i8369C1E5990ADF3E/image-size/small?v=v2&amp;amp;px=200" role="button" title="그림1.png" alt="그림1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;2.&amp;nbsp;program execution code&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[Please refer to the attached file for Excel VBA code.]&lt;BR /&gt;**********************************************************************************&lt;/P&gt;&lt;P&gt;Dim BaseSession As pfcls.IpfcBaseSession&lt;BR /&gt;Dim Session As IpfcSession&lt;BR /&gt;Dim model As pfcls.IpfcModel&lt;BR /&gt;Dim Solid As IpfcSolid&lt;BR /&gt;Dim ModelItemOwner As IpfcModelItemOwner&lt;BR /&gt;&lt;BR /&gt;'// Current Model Information&lt;BR /&gt;Set BaseSession = conn.Session&lt;BR /&gt;Set model = BaseSession.CurrentModel&lt;BR /&gt;Set Solid = model&lt;BR /&gt;Set ModelItemOwner = Solid&lt;BR /&gt;&lt;BR /&gt;*****&lt;BR /&gt;&lt;BR /&gt;'// SET Regenerate&lt;BR /&gt;Dim RegenInstructions As New CCpfcRegenInstructions&lt;BR /&gt;Dim Instrs As IpfcRegenInstructions&lt;BR /&gt;Set Instrs = RegenInstructions.Create(False, False, Nothing)&lt;BR /&gt;&lt;BR /&gt;Dim BaseDimension As IpfcBaseDimension&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim j As Long&lt;BR /&gt;&lt;BR /&gt;For j = 0 To rng.Count - 1&lt;BR /&gt;&lt;BR /&gt;Set BaseDimension = ModelItemOwner.GetItemByName(EpfcModelItemType.EpfcITEM_DIMENSION, Cells(j + 6, "B"))&lt;BR /&gt;&lt;BR /&gt;'//&amp;nbsp;Send entered dimension values to model&lt;BR /&gt;BaseDimension.DimValue = Cells(j + 6, "C")&lt;BR /&gt;&lt;BR /&gt;Next j&lt;BR /&gt;&lt;BR /&gt;'// Regenerate&lt;BR /&gt;Call Solid.Regenerate(Instrs)&lt;BR /&gt;Call Solid.Regenerate(Instrs)&lt;BR /&gt;&lt;BR /&gt;'// Window Repaint&lt;BR /&gt;Dim Window As pfcls.IpfcWindow&lt;BR /&gt;Set Window = BaseSession.CurrentWindow&lt;BR /&gt;&lt;BR /&gt;Window.Repaint&lt;BR /&gt;&lt;BR /&gt;conn.Disconnect (2)&lt;BR /&gt;*****************************************************&lt;BR /&gt;How to use the program&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1.&amp;nbsp;Change the name of a dimension in a model.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; . Example) ADD375 -&amp;gt; DOM01&lt;BR /&gt;&lt;BR /&gt;2.&amp;nbsp;Enter the name of the dimension in your model under Cells(6,B).&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .Three or more sizes are also possible.&lt;BR /&gt;&lt;BR /&gt;3. Click the GET button&lt;BR /&gt;&amp;nbsp; &amp;nbsp; . Retrieves dimension values from model&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4. Click the Change button&lt;BR /&gt;&amp;nbsp; &amp;nbsp; . Change the dimension value and click the change button&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 12:20:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-change-PART-model-with-Excel-VBA/m-p/939033#M12954</guid>
      <dc:creator>cko</dc:creator>
      <dc:date>2024-03-25T12:20:39Z</dc:date>
    </item>
  </channel>
</rss>

