Interface ODB++ Files

Hyountag Oh
Your name: 
Hyountag Oh

I tested this code.
and i checked the PCBI load ODB++ files

but i don't know how i can access the odblayer, odbobject, ILinesSpecific, IArcSpecific.....

i want to extract the raw feature ( like circle, line, surface,,,,,)

PCBI.Automation.IPCBIWindow window;

public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
window = IAutomation.CreateNewPCBIWindow(true);
window.LoadODBJob("c:\\mgf12024");
window.Show();
}

easylogix

Hi Hyountag Oh,

Here is a simple example to get all the lines from the ODB ++ job, you can simply replace the ILineSpecifics with other Specifics for arcs or pads.

private List GetAllLines( PCBI.Automation.IPCBIWindow window)
{
List returnListWithAllLines = new List();
if (!window.JobIsLoaded)
return returnListWithAllLines;

IStep currentStep = window.GetCurrentStep(); //window.GetStep("name"); //(alternativ it you want a specific step)

//ILayer selectedLayer = currentStep.GetLayer("name"); //íf you know the name of the layer you can use this

IMatrix jobMatix = window.GetMatrix();

foreach (string layername in currentStep.GetAllLayerNames())
{
if (jobMatix.GetMatrixLayerType(layername) != MatrixLayerType.Signal) //example to use the matrix informations
continue;

if (jobMatix.GetMatrixLayerContext(layername) != MatrixLayerContext.Board) //example to use the matrix informations
continue;

ILayer currentLayer = currentStep.GetLayer(layername); //load the layer

if (currentLayer is IODBLayer)
{
//only for IODBLayers

List LayerItems = currentLayer.GetAllLayerObjects();

foreach (IODBObject odbObject in LayerItems) //this is only possible for IODBLayers, e.g. for ICMPLayers you get an exception!
{
IObjectSpecifics specifics = odbObject.GetSpecifics();

//if(odbObject.Type == IObjectType.Line) //or use:
if (specifics is ILineSpecifics) //check is this a line?
{
returnListWithAllLines.Add((ILineSpecifics)specifics);
}
}
}
}

return returnListWithAllLines;
}

For the raw feature information you need the IODBObject.GetSpecifics(), the best is to hold the IODBObject and the specifics in memory, if you want to change some parts of an IODBObject you have to use IODBObject.SetSpecifics(specifics);

Hope this helps

Reply to Thread

The content of this field is kept private and will not be shown publicly.
CAPTCHA
Your comment will have to be approved by us before it is posted.
Image CAPTCHA
Enter the characters shown in the image.