Skip to main content
16-Pearl
February 26, 2020
Question

.vb keyword to hide a part?

  • February 26, 2020
  • 2 replies
  • 2562 views

to all

 

Can't find what I am looking for in the help. In .vb I am looking for the commande/keyword to hide a part/model

I am looping through parts of an assy (Dim Model As IpfcModel) and would like to hide the part being processed based on some criteria.

Can anyone help point me in the right direction?

Thanks

2 replies

24-Ruby III
February 27, 2020

Hi,

I guess that according to https://www.ptc.com/en/support/article/CS48164 you have to "Create a mapkey and execute it using the method Session.runMacro()".

16-Pearl
February 27, 2020

thanks. But what is the api method, properties I need to use to hide the part (based on acriteria) while looping through an entire assembly?

24-Ruby III
February 28, 2020

@JBlackhole wrote:

thanks. But what is the api method, properties I need to use to hide the part (based on acriteria) while looping through an entire assembly?


Hi,

I already answered your question. It looks like the only available method is Session.runMacro(). Therefore you have to create suitable mapkey and call Session.runMacro() method for every component you want to hide.

14-Alexandrite
March 2, 2020

When you apply the "Hide" command on a component or a feature that particular component is placed in a special layer called "Hidden Items"

I'm not familiar with the VB API's but it looks like IpfcLayer.AddItem may be what you are looking for.

 

16-Pearl
March 3, 2020

Thanks a lot for that - this might well be what I was looking for. Will play with a test case

I think what I may actaully want to do long therm is to have a option:-  Hide or Exclude.

Any idea what 's the API for: Representation/ Exclude?

 

Thansk

Regards