korbn
September 21, 2021, 12:07pm
1
in hook Edm_Cmd_PostState i have recieved mlObjectID3(integer) with the ID of transition.
how can i resolve this ID to transition Name(string)?
can’t find how do it in API-help…
PS: make query to SQL server table [dbo].[Transitions] is not a good idea))))
bnemec
September 21, 2021, 1:47pm
2
I’m curious about why is query to SQL table not a good idea.
Thank you
korbn
September 22, 2021, 7:48am
3
I’m a so-so programmer, and I’m not sure that I can implement this with proper code security. the password will be sewn into the program.
but I came up with a scheme for how to do this without crutches, using built-in PDM methods.
for example, as described here, we grab all the transitions in the desired state.
https://help.solidworks.com/2019/English/api/epdmapi/Get_Files_State_Transitions_Example_CSharp.htm
each object has an ID property. we read it for each transition.
http://help.solidworks.com/2017/english/api/epdmapi/EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmObject5~ID.html
adding the ID-NAME data to the C# dictionary
and now we can resolve transition name from its ID)))
bnemec
September 22, 2021, 3:02pm
4
You’re explanation lead me to this:
GetObject(type, ID)
GetObject Method (IEdmVault5) - 2017 - SOLIDWORKS API Help
Type of object is 4
EdmObjectType Enumeration - 2017 - SOLIDWORKS API Help
cast it to transition then get the name from that?
3 Likes
korbn
September 22, 2021, 3:21pm
5
brilliant! thx! but for now, its the biggest problem - IEdmBatchUnlock Interface
how to override version…
JJZ
December 3, 2021, 2:26pm
6
Hi Korbn,
You can use this:
IEdmTransition5 edmTransition =(IEdmTransition5) EdmVault.GetObject(EdmObjectType.EdmObject_Transition, 0);
string name = edmTransition.Name;
1 Like