howto get project properties or parameters

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

Moderators: remi77, Daniel, jacs

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

howto get project properties or parameters

Unread post by cam » Wed Jun 22, 2016 5:00 pm

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
Master Chief
Master Chief
Posts: 127
Joined: Tue Sep 09, 2014 5:45 pm
TopSolid Module: TopSolid'Design
TopSolid Version: 7.14

Re: howto get project properties or parameters

Unread post by JuP » Fri Jun 24, 2016 6:09 am

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 . P
Youtube
Grabcad

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

Re: howto get project properties or parameters

Unread post by cam » Fri Jun 24, 2016 2:04 pm

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: 7.6

Re: howto get project properties or parameters

Unread post by gmanucci » Thu Jul 07, 2016 2:30 pm

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
Master Chief
Master Chief
Posts: 127
Joined: Tue Sep 09, 2014 5:45 pm
TopSolid Module: TopSolid'Design
TopSolid Version: 7.14

Re: howto get project properties or parameters

Unread post by JuP » Thu Jul 07, 2016 5:32 pm

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 . P
Youtube
Grabcad

Post Reply