Reply
Solved! Go to solution

How to find the Bend Equation?

Hello All,

 

How to find the Bend Equation?

i.e. I just want to know whether Standard Formula is checked or Custom Formula is Checked.

 

I found there is a method in SolidEdge Constants Type Library : SheetMetalGlobalConstantsBendEquationType.

 

But please let me know how to use this method?

 

Thank you

7 REPLIES
Solution
Solution
Accepted by jnewell (Solution Partner Phenom)
‎08-26-2015 04:32 AM

I am no sheetmetal expert and I don't know how to change...

I am no sheetmetal expert and I don't know how to change the bend equation type in the UI, but to get the current type through API, you should use the GetGlobalParameter method on the SheetMetalDocument:

'----------------------------------------------------------------------
' PSM: Get the bend equation type
'----------------------------------------------------------------------
Dim objDoc As SolidEdgePart.SheetMetalDocument = objApp.ActiveDocument
Dim bendType As SolidEdgeConstants.SheetMetalGlobalBendEquationConstants
objDoc.GetGlobalParameter(SheetMetalGlobalConstants.seSheetMetalGlobalBendEquationType, bendType)
MsgBox("Bend Equation Type:  " & bendType.ToString())

 

Re: I am no sheetmetal expert and I don't know how to change...

Hi Martin,

I tried the above solution but as soon as the statement GetGlobalParameter is executed it gives exception as SolidEdge has stopped working and exits.

Re: I am no sheetmetal expert and I don't know how to change...

Martin's example looks good so I'm not sure why you're getting an exception. If you'll download http://solidedgesamples.codeplex.com, there is a example project demonstrating how to work with global properties. The project name is SolidEdge.GlobalParameters and is a WinForm application.
Jason Newell
Applications Architect
www.jasonnewell.net

Re: I am no sheetmetal expert and I don't know how to change...

I tried debugging it gives the following error
"Cannot find the interop type that matches the embedded type 'SolidEdgePart.SheetMetalGlobalConstants'. Are you missing an assembly reference?"

This error is there for both GetGlobalParameter and SetGlobalParameter.

I have made a reference to SolidEdge.PartType Library.

Please help.

Re: I am no sheetmetal expert and I don't know how to change...

Which version of SE are you using?
I tried to find when these constants were added in SE from the help file, but I could not...

Re: I am no sheetmetal expert and I don't know how to change...

I am using SE ST6 and Visual Studio 2010.
I changed in Properties as not to embed the references and I was able to overcome missing assembly reference error.

But Now I am getting the following error
"A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll"

Please provide a sample code if possible.

Thanks

Re: I am no sheetmetal expert and I don't know how to change...

Try downloading the samples from Codeplex, like Jason suggested. They are complete and you might easily change the constants to the one of your choice..