Skip to main content
Feb 26, 2020 7:51 AM UTC
Question

.vb keyword to hide a part?

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

7 replies

Feb 27, 2020 12:48 PM UTC

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()".

Feb 27, 2020 6:25 PM UTC

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?

Feb 28, 2020 7:25 AM UTC

@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.

Mar 2, 2020 8:51 PM UTC

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.

 

Mar 3, 2020 12:17 PM UTC

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