Reply

Adjustable part API

Hello All,

 

It's been a while since I don;t do any Solid Edge programming, but coming back. Have this problem I have this subrutine that errors out on this line, please see the attachment for the error messsages I get.

 

partToAdjust.SetAdjustables(entries, partVariables, partNotes);

 

 

This is the sub routine:

public void setAdjustablePart(int entries, object[]partVariables, object[]partNotes, int itemNo)

{

SolidEdgeFramework.Application application = null;

SolidEdgeAssembly.AssemblyDocument unitAssy = null;

SolidEdgePart.PartDocument unitPart =null;

AdjustablePart partToAdjust = null;

try

{

// Connect to running Solid Edge Instance

application = (SolidEdgeFramework.Application)

Marshal.GetActiveObject("SolidEdge.Application");

unitAssy = application.ActiveDocument;

partToAdjust = unitAssy.Occurrences.Item(itemNo).GetAdjustablePart();

unitPart = partToAdjust.Occurrence.OccurrenceDocument;

partToAdjust.SetAdjustables(entries, partVariables, partNotes);

}

catch (System.Exception ex)

{

System.Windows.Forms.MessageBox.Show(string.Concat("Error Opening Solid Edge File ", ex.ToString()));

Console.WriteLine(ex.Message);

}

finally

{

OleMessageFilter.Revoke();

}

}