Vítejte !   Přihlášení | Registrace
Hlavní menu
CATIA fórum.cz
Novinky
Seriál CATIA
Obecně o CAD
Novinky ze světa DS
Makra pro CATIA V5
Diskuse
Vytvořit téma
Koncepty
Seznam oblíbených
Soukromé zprávy
Pravidla
Live CHAT
VIP žádost
Základy Catia
Ke stažení
Doporučujeme
Pracovní příležitosti
Reklama a kampaně
O fóru
Nápověda

RootParameterSet not working - CATIA API

Kompletní přehled příspěvků v tématu RootParameterSet not working - CATIA API řazený podle data jejich publikace na fóru.

UživatelPříspěvek
Nirantar Vidyarthee

Poslat zprávu | Profil
Datum: 5.5. 2023 | Zobrazeno: 762x
Konfigurace CATIA: V5

Text dotazu:
Hello,

When I access the RootParameterSet object of a ProfuctDocument.Product it does not contain any parameters.

The ProductDocument.Product.Parameters. RootParameterSet.AllParameters.Count returns 0 (zero) when there are default 5 Parameters in every ProductDocument.

What am I doing wrong?

I have explored for any Option / Setting and searched the net also without any success.

Thank you for any help.

Ing Jan Cinert

Poslat zprávu | Profil
[#7139] | Publikováno: 05.05. 2023 - 13:09
Hi,

I did a quick test and it seems this is normally working. Have a look at the attached image with a small example. The script always returns what is expected.

A tip for you. Try to use object Document.Product.ReferenceProduct.. instead of Document.Product, maybe it helps....

Přiložené obrázky:

Nirantar Vidyarthee

Poslat zprávu | Profil
[#7140] | Publikováno: 05.05. 2023 - 15:12
Appreciate your prompt response.
I am trying to access the parameters of the Top ProductDocument.
I was expecting that the default parameters like 'Part Number' could be accessed through RootParameterSet which I now understand was wrong.
When I added a user parameter to the top assembly, then count showed 1.
Since I am accessing Top Assembly Document, there is no need to use ReferenceProduct property.
Also, it now seems that the RootParameterSet can contain only User Defined parameter. (DirectParameters property). So, I am just wondering what additional parameters can AllParameters collection contain.
Ing Jan Cinert

Poslat zprávu | Profil
[#7141] | Publikováno: 10.05. 2023 - 18:42
The RootParameterSet represents the "container" where users parameters are strored (and also located in tree).
PartNumber (and Description, Revision etc) are properties of a Product object (but also can be accesed like parameters), and the last group of parameters is UserRefProperties.

The best approach how to access the specific parameter is via Item method. I am not 100% sure at the moment but I think that the collection Part / Product.Parameters contains all in Part / Product existing parameters.

Only when you want to list parameters of specific set you can play with ParametersSet. There is also a method Sublist which returns nested (or maybe better said added) user parameters e.g. in a Sketch etc.


Uživatel nepřihlášen

Pro zobrazení obsahu stránky / provedení akce (vytvoření nového téma, napsání odpovědi do diskuse apod.) musíte být přihlášeni.