cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

.vb keyword to hide a part?

JBlackhole
16-Pearl

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

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


Martin Hanák

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?


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


Martin Hanák

My apologies I mis-understood and got my wire crossed.

Not what I want and there must be an easier easy. some api have .IsVisible

maybe works with:  IpfcComponentPath.GetIsVisible

           Returns a flag indicating whether a given component is visible in a simplified representation


@JBlackhole wrote:

My apologies I mis-understood and got my wire crossed.

Not what I want and there must be an easier easy. some api have .IsVisible

maybe works with:  IpfcComponentPath.GetIsVisible

           Returns a flag indicating whether a given component is visible in a simplified representation


Hi,

VBAPI is available for free -AND- its functionality is very limited. Usually you can get information about object properties but you cannot set object properties. That's how it is. Please accept this status and learn to live with it.

 

If you want to use more powerful API then you have to buy it (I mean Creo TOOLKIT).


Martin Hanák

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.

 

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

Announcements


Top Tags