Navigation:  C/C++ Scripting Engine > Sample C/C++ Script Code >

deembed.c

Previous pageReturn to chapter overviewNext page

Create multiple objects that overlap, and then use De-Embed layer

bar_dot

 

 

#include "Fab3000.h"

 

int main ()

{

 //Set user units to inch.

 dbSetUserUnits( dbcInch );

 

 //Create Layer #1

 uiEditAddLayer( "metal", 1 );

 

 //Create Polygon 1

 dbPointArray arPts;

 arPts.appendPt( 1,1 );

 arPts.appendPt( 3.5,1.1 );

 arPts.appendPt( 3.6,4.0 );

 arPts.appendPt( 2.0,3.2 );

 arPts.appendPt( 1,3.5 );

 arPts.appendPt( 1,1 );

 uiAddPolygon( 1, 0, &arPts );

 

 //Create Polygon 2

 arPts.clear();

 arPts.appendPt( 2,1.5 );

 arPts.appendPt( 3,2.0 );

 arPts.appendPt( 3,3.0 );

 arPts.appendPt( 2.2,3.0 );

 arPts.appendPt( 2,1.5 );

 uiAddPolygon( 1, 0, &arPts );

 

 //Create Polygon 3

 arPts.clear();

 arPts.appendPt( 0,0 );

 arPts.appendPt( 5,0 );

 arPts.appendPt( 5,5 );

 arPts.appendPt( 0,5 );

 arPts.appendPt( 0,0 );

 uiAddPolygon( 1, 0, &arPts );

 

 //Create Apertures

 dbAperture aperture;

 aperture.setType( dbApertureTypeCircle );

 aperture.setWidth( 0.2 );

 dbSetAperture( 10, &aperture );

 

 dbAperture aperture2;

 aperture2.setType( dbApertureTypeRect );

 aperture2.setWidth( 0.2 );

 aperture2.setHeight( 0.15 );

 dbSetAperture( 12, &aperture2 );

 

 //Add Some Flashes

 dbPoint pt;

 dbSetActiveDcode( 10 ); //Note: Sets the Active Dcode to 10

 pt.set( 0.4, 0.4 );

 uiAddFlash( 1, 0, &pt );

 pt.set( 2.5, 2.5 );

 uiAddFlash( 1, 0, &pt );

 pt.set( 4.5, 0.4 );

 uiAddFlash( 1, 0, &pt );

 pt.set( 4.5, 4.5 );

 uiAddFlash( 1, 0, &pt );

 pt.set( 0.4, 4.5 );

 uiAddFlash( 1, 0, &pt );

 dbSetActiveDcode( 12 ); //Note: Sets the Active Dcode to 12

 pt.set( 1.4, 1.4 );

 uiAddFlash( 1, 0, &pt );

 pt.set( 2, 4 );

 uiAddFlash( 1, 0, &pt );

 pt.set( 2.5, 2.1 );

 uiAddFlash( 1, 0, &pt );

 

 //Array

 dbSelectionSet sset;

 int nCount = sset.selectAll();

 if( nCount )

 {

         uiEditArray( &sset, 3, 2, 5.5, 6 );

 }

 

 //Create Output Layer

 uiEditAddLayer( "deembed", 2 );

 

 //Perform De-Embed

 uiToolsDeEmbedLayer( 1, 2 );

 

 //Zoom All

 uiViewZoomAll();

 return 0;

}