howto get project properties or parameters

All topics about specific development with COM interface, LIP language, API in VB, ...

Moderators: remi77, jacs, Daniel

cam
Master Corporal
Master Corporal
Posts: 39
Joined: Fri Oct 02, 2009 9:46 am
TopSolid Module: TopSolid'Cam
TopSolid Version: 7.8
Location: Germany

howto get project properties or parameters

Unread post 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.
Last edited by cam on Fri Jun 24, 2016 2:05 pm, edited 1 time in total.
Greetings
Chris
User avatar
JuP
Major
Major
Posts: 169
Joined: Tue Sep 09, 2014 5:45 pm
Answers: 6
TopSolid Module: TopSolid'Steel
TopSolid Version: 7.14

Re: howto get project properties or parameters

Unread post 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).
Julien POIROT
TopSolid'Steel Product Manager
Youtube
GrabCad
Facebook
cam
Master Corporal
Master Corporal
Posts: 39
Joined: Fri Oct 02, 2009 9:46 am
TopSolid Module: TopSolid'Cam
TopSolid Version: 7.8
Location: Germany

Re: howto get project properties or parameters

Unread post by cam »

Hello,

thank you very mutch.
Now it works well.
Fine thing.....
Greetings
Chris
gmanucci
Master Corporal
Master Corporal
Posts: 49
Joined: Tue Sep 29, 2015 2:48 pm
TopSolid Module: TopSolid'Cam
TopSolid Version: 6.26

Re: howto get project properties or parameters

Unread post 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).
User avatar
JuP
Major
Major
Posts: 169
Joined: Tue Sep 09, 2014 5:45 pm
Answers: 6
TopSolid Module: TopSolid'Steel
TopSolid Version: 7.14

Re: howto get project properties or parameters

Unread post 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 !
Julien POIROT
TopSolid'Steel Product Manager
Youtube
GrabCad
Facebook
Post Reply