Document Status

I would like to be able to change the status of a Document to Available, however, when I try to in code, it tells me I can not write to a read-only property.

Jason, you've seemed to have accomplished this with your power-toy add on to the windows shell, which is great by the way...

I need to be able to crawl a large folder tree with 20+ gigs of solid edge files and set them all to Available. We are going to skip our released document library and are going to put windows security on the remaining files, so this is all 'safe.'

Is there any way you can help me with this one. It's had me stumped for days!

 

Travis May

 

Posted by: Travis May
Post date: 2/20/2012 10:47:12 AM

7 REPLIES

Re: Document Status

Travis,

 

I have not tried this via any Solid Edge API in a long time but I suspect their API is what is blocking you. Exactly why PowerToys doesn't use their APIs. The best\easiest way to write this is actually in C++. I'll see if I can whip something together quick and post you something.

 

Posted by: Jason Newell
Post date: 2/21/2012 12:21:54 AM

Re: Document Status

Hi

 

try this

 

SolidEdgeFramework.Application seApp = Marshal.GetActiveObject("SolidEdge.Application") as SolidEdgeFramework.Application;
SolidEdgeFramework.SolidEdgeDocument seDoc = seApp.ActiveDocument;

MessageBox.Show(seDoc.Status.ToString());

seDoc.Status=SolidEdgeFramework.DocumentStatus.igStatusInWork;
MessageBox.Show(seDoc.Status.ToString());

seDoc.Status = SolidEdgeFramework.DocumentStatus.igStatusAvailable;
MessageBox.Show(seDoc.Status.ToString());

 

Posted by: Wolfgang Kunert
Post date: 2/21/2012 9:36:58 AM

Re: Document Status

Jason, I'm getting the following error:

 

 

PInvokeStackImbalance was detected

Message: A call to PInvoke function 'SECrawlCS!SECrawlCS.Program:Smiley FrustratedetDocumentStatusToAvailable' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

 

Posted by: Travis May
Post date: 2/21/2012 9:38:12 AM

Re: Document Status

Seems to have worked. I'll get a solidedge guy to verify, but it's looking good from here!

 

Now to recursive me some folders... Smiley Happy

 

Thanks Jason!

 

Posted by: Travis May
Post date: 2/21/2012 11:58:27 AM

Re: Document Status

[quote="Travis May" post=4461]I would like to be able to change the status of a Document to Available, however, when I try to in code, it tells me I can not write to a read-only property.

Jason, you've seemed to have accomplished this with your power-toy add on to the windows shell, which is great by the way...

[b]I need to be able to crawl a large folder tree with 20+ gigs of solid edge files [/b]and set them all to Available. We are going to skip our released document library and are going to put windows security on the remaining files, so this is all 'safe.'

Is there any way you can help me with this one. It's had me stumped for days!

 

Travis May[/quote]

 

Posted by: Travis May
Post date: 2/24/2012 1:59:17 PM

Re: Document Status

[quote="Travis May" post=4461]I would like to be able to change the status of a Document to Available, however, when I try to in code, it tells me I can not write to a read-only property.

Jason, you've seemed to have accomplished this with your power-toy add on to the windows shell, which is great by the way...

[b]I need to be able to crawl a large folder tree with 20+ gigs of solid edge files [/b]and set them all to Available. We are going to skip our released document library and are going to put windows security on the remaining files, so this is all 'safe.'

Is there any way you can help me with this one. It's had me stumped for days!

 

Travis May[/quote]

 

Emphasis added...

 

Posted by: Travis May
Post date: 2/24/2012 1:59:40 PM

Re: Document Status

However, I do thank you as well Wolfgang, I will use your code most likey when my guys post something to our "released" area.

 

Posted by: Travis May
Post date: 2/24/2012 2:03:03 PM