Page 1 of 1

howto get project properties or parameters

Posted: Wed Jun 22, 2016 5:00 pm
by cam
Hi,

how can I get the parameters of the project in C# code.
Like in this video at 0:40
https://www.youtube.com/watch?v=yiiOzfSNn-M
The access to the edited document parameters works.

Re: howto get project properties or parameters

Posted: Fri Jun 24, 2016 6:09 am
by JuP
Hello,

It's in vb.net but the idea is the same:

Code: Select all

TopSolidDesignHost.Connect()
Dim ActiveDocumentId As DocumentId
ActiveDocumentId = TopSolidHost.Documents.EditedDocument

Dim ObjectId As PdmObjectId
ActiveDocumentObjectId = TopSolidHost.Documents.GetPdmObject(ActiveDocumentId )

Dim ActiveProjectID As PdmObjectId
ActiveProjectID = TopSolidHost.Pdm.GetProject(ActiveDocumentObjectId )       
After that, use Pdm methods:
TopSolidHost.Pdm.GetDescription(ActiveProjectID)
Get name, manufacturer ...

You can also work in the project document and get all parameters (using Parameters.GetParameters).

Re: howto get project properties or parameters

Posted: Fri Jun 24, 2016 2:04 pm
by cam
Hello,

thank you very mutch.
Now it works well.
Fine thing.....

Re: howto get project properties or parameters

Posted: Thu Jul 07, 2016 2:30 pm
by gmanucci
just in addition, for getting/modifying customer properties (inside the project) you have to use the code given by system info, like "$TopSolid.Kernel.TX.Properties.DeliveryDate" or so.

i've created a base class called File then i created all other classes (cam files, project files, draft files, etc) with they common properties (get/set).

Re: howto get project properties or parameters

Posted: Thu Jul 07, 2016 5:32 pm
by JuP
gmanucci wrote:just in addition, for getting/modifying customer properties (inside the project) you have to use the code given by system info, like "$TopSolid.Kernel.TX.Properties.DeliveryDate" or so.

i've created a base class called File then i created all other classes (cam files, project files, draft files, etc) with they common properties (get/set).
Yes it's the best way I think ! Thanks !