<?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 Re: VB API Creo - identify suppressed parts from assembly and delete : Help in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/848661#M11814</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/407769"&gt;@Ragnarok8979&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you write the code? I need help with the same task&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2023 08:16:18 GMT</pubDate>
    <dc:creator>MJ_0919</dc:creator>
    <dc:date>2023-01-11T08:16:18Z</dc:date>
    <item>
      <title>VB API Creo - identify suppressed parts from assembly and delete : Help</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/741055#M10460</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please help me to get a code for identify suppressed parts and delete them from assembly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am using visual studio 2017 for VB API. I am struggling since a long for this. your help will really make me move forward and would really be appreciated for your inputs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advanced!!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 11:05:07 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/741055#M10460</guid>
      <dc:creator>Ragnarok8979</dc:creator>
      <dc:date>2021-07-29T11:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: VB API Creo - identify suppressed parts from assembly and delete : Help</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/741056#M10461</link>
      <description>&lt;P&gt;&lt;A href="https://community.ptc.com/t5/user/viewprofilepage/user-id/67152" target="_blank"&gt;@Ketan_Lalcheta&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.ptc.com/t5/user/viewprofilepage/user-id/451462" target="_blank"&gt;@NM_9425708&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.ptc.com/t5/user/viewprofilepage/user-id/315997" target="_blank"&gt;@HanSolo97&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.ptc.com/t5/user/viewprofilepage/user-id/43740" target="_blank"&gt;@RPN&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.ptc.com/t5/user/viewprofilepage/user-id/133409" target="_blank"&gt;@lhoogeveen&lt;/A&gt;&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/2137"&gt;@sgudla&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/271133"&gt;@Zynk&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/245044"&gt;@remy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Guys your help needed!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 11:08:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/741056#M10461</guid>
      <dc:creator>Ragnarok8979</dc:creator>
      <dc:date>2021-07-29T11:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: VB API Creo - identify suppressed parts from assembly and delete : Help</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/741110#M10462</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when searching the keywords "visit component VB API" in the knowledge base you will find this article that looks close to your request:&amp;nbsp;&lt;A href="https://www.ptc.com/en/support/article/CS172949" target="_blank"&gt;https://www.ptc.com/en/support/article/CS172949&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Maybe you can start from there.&lt;/P&gt;
&lt;P&gt;Instead of testing&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;If (subComponents.Item(i).Status = EpfcFeatureStatus.EpfcFEAT_ACTIVE&lt;/LI-CODE&gt;
&lt;P&gt;Try and find the "Suppressed" Status in the API wizard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 14:49:01 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/741110#M10462</guid>
      <dc:creator>remy</dc:creator>
      <dc:date>2021-07-29T14:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: VB API Creo - identify suppressed parts from assembly and delete : Help</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/741517#M10470</link>
      <description>&lt;P&gt;I don't work with VB, only C and Tcl, here some thoughts, ouput and code in Tcl.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: there a couple of reason why a feature may suppressed, I delete only the suppressed ones, not the ones suppressed by Pro/Program or other reasons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# Simple proc to export text 
# to debug and the user log
proc ToMessLog {msg} {
	Debug $msg
	ps_mess $msg
}

proc DelSuppComp {} {
#	Get the current Model Name for output purpose only
	set CurModel [ps_model current]
	ToMessLog "Run Delete Suppressed Components in Assembly '$CurModel'"

# First get all components from the active Assembyl
# Order First to Last created (like in Creo)
	set CompIDsFL	[ps_visit type COMPONENT]

# reverse the order from '10 34 55' to '55 34 10'
# without doing this, a component may already deleted
	set CompIDs [lreverse $CompIDsFL]


# Get the Status for each ID
# Do this for all ID, else we would need to do this within the foreach loop
	set CompStats [ps_feat status $CompIDs]
# Note: Both lists (CompStats and CompIDs) have now the same amount of items

# Just a counter
	set DelComp	0

	foreach CompID $CompIDs CompStat $CompStats {
		switch $CompStat	{

			SUPPRESSED	{

				set NumOfChild [llength [ps_feat children $CompID]]

				# On feature delete you can specify this options in a list:
				# NONE, CLIP, INTERACTIVE, RELATION_DELETE, RELATION_COMMENT, CLIP_ALL, OUT_OF_GROUP, CLIP_OUT_OF_GROUP, or KEEP_EMBED_DATUMS
				set option NONE

				if {$NumOfChild != 0} {
					ToMessLog "Component ID '$CompID' has suppressed feature as well"
					set option CLIP
				}

				# Finally delete the Component and increment the counter
				ToMessLog "Delete Component ID '$CompID' Name '[ps_assy component_name $CompID]' with option '$option'"
				ps_feat delete -option $option -- $CompID

				incr DelComp

			}
			default	{
				#Do nothing here
			}
		}
	}
	ToMessLog "Deleted '$DelComp' components feature IDs..."
}

# Just call it
DelSuppComp &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the engine.asm from PTC as an example, but added a reference datum plane to one bolt, here one image before and after including the Message Log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RPN01090.png" style="width: 999px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/44612iCFB37CE0B2F1F9A8/image-size/large?v=v2&amp;amp;px=999" role="button" title="RPN01090.png" alt="RPN01090.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Vars content&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CompIDsFL {1360 1277 148 44 151 45 52 55 100 105 109 164 165 168}&lt;BR /&gt;CompIDs {168 165 164 109 105 100 55 52 45 151 44 148 1277 1360}&lt;BR /&gt;CompStats {SUPPRESSED SUPPRESSED ACTIVE SUPPRESSED ACTIVE ACTIVE ACTIVE SUPPRESSED ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy/Paste of the Message Log:&lt;/P&gt;
&lt;P&gt;Run Delete Suppressed Components in Assembly 'ENGINE.ASM'&lt;BR /&gt;Delete Component ID '168' Name 'CONNECTING_ROD.PRT' with option 'NONE'&lt;BR /&gt;Delete Component ID '165' Name 'PISTON.ASM' with option 'NONE'&lt;BR /&gt;Component ID '109' has suppressed feature as well&lt;BR /&gt;Delete Component ID '109' Name 'BOLT_5-28&amp;lt;BOLT&amp;gt;.PRT' with option 'CLIP'&lt;BR /&gt;Delete Component ID '52' Name 'BOLT_5-18&amp;lt;BOLT&amp;gt;.PRT' with option 'NONE'&lt;BR /&gt;Deleted '4' components feature IDs...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun with VB&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Aug 2021 12:15:14 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/741517#M10470</guid>
      <dc:creator>RPN</dc:creator>
      <dc:date>2021-08-01T12:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: VB API Creo - identify suppressed parts from assembly and delete : Help</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/848661#M11814</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/407769"&gt;@Ragnarok8979&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you write the code? I need help with the same task&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 08:16:18 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/VB-API-Creo-identify-suppressed-parts-from-assembly-and-delete/m-p/848661#M11814</guid>
      <dc:creator>MJ_0919</dc:creator>
      <dc:date>2023-01-11T08:16:18Z</dc:date>
    </item>
  </channel>
</rss>

