How to retrieve the properties of a configuration

Hello

I'd like to know if anyone knows the synthesis to retrieve the content of the description and comments of a configuration (see attached image).
For the configuration name, it is: $PRPVIEW:"SW-Configuration Name"
But for the others: ???
I tried a bit by replacing "Name" with "Description", but no result.

If you know other codes, I'm interested...

 


prop._config_sw14.jpg

Hello

A  priori it is possible, but a bit complicated, see this message:

https://forum.solidworks.com/message/467771#467771

 

Hello

Yes, see capture of the background of the capture.

Keep me up to date if it's ok.

 

Have a nice day


syntaxe.jpg

@mickael

I'm looking for this kind of code, but for the description of the configuration. I already have them.

@ .PL

Thank you for the link, but indeed it's complicated and I don't master VB.

Hello

 

Maybe this link can help:

http://www.javelin-tech.com/blog/2012/03/hierarchy-bom-refs/

@Azrod

Thank you, well tried. However, I would need it somewhere other than in a BOM.

I tried to retrieve the code from the BOM, but it doesn't work.

If anyone has another idea....


prop._config_sw14.jpg

Isn't it $PRPMODEL: "Description"?

And the same thing with commentary

EDIT:

No, that's not it...

Hi all

I would also like to retrieve the content of the description and comments of a configuration on my computer, unfortunately, everything I do gets me nowhere. Maybe your advice can help me. In any case, I'll see if it works. Thank you for your help.

So far, to overcome the problem, it is to create custom properties by config and copy the info I put under the config. It's a bit redundant and when I modify a config, don't forget to go and modify the properties. Not great.

Help someone?


lynkoa_1.jpg

So far, to overcome the problem, it is to create custom properties by config and copy the info I put under the config. It's a bit redundant and when I modify a config, don't forget to go and modify the properties. Not great.

Hello

Here's a snippet of C# code that does the job:

ModelDoc2 Part;
Part = ((ModelDoc2)(swApp.ActiveDoc));

ConfigurationManager swConfigMgr;
Configuration swConfig;
swConfigMgr = Part.ConfigurationManager;
swConfig = swConfigMgr.ActiveConfiguration;
			
object[] configNameArr = null;
string configName = null;
string commentaire = null;
string description = null;
int j = 0;
configNameArr = (object[])Part.GetConfigurationNames();
for (j = 0; j <= configNameArr.GetUpperBound(0); j++)
{
  configName = (string)configNameArr[j];
  swConfig = (Configuration)Part.GetConfigurationByName(configName);
  commentaire = swConfig.Comment;
  description = swConfig.Description;
  MessageBox.Show("Nom : " + swConfig.Name + " - Commentaire : " + commentaire + " - Description : " + description);
            }
			
MessageBox.Show("Traitement terminé.");

Kind regards

And now the macro in vba....


listenameconfig.swp