Hi Muhammed Karattu,
Challenge is met. Try the following code:
try {
Presentation pres=new Presentation("d:\\ppt\\smartart\\Organization+Chart.ppt");
Slide sld=pres.getSlideByPosition(1);
GroupShape gshp=null;
AutoShape ashp=null;
ByteArrayOutputStream bout=new ByteArrayOutputStream();
for(int i=0;i<sld.getShapes().size();i++)
{
if(sld.getShapes().get(i) instanceof com.aspose.slides.GroupShape)
{
gshp=(com.aspose.slides.GroupShape)sld.getShapes().get(i);
for(int j=0;j<gshp.getShapes().size();j++)
{
if(gshp.getShapes().get(j).getAlternativeText().endsWith("def"))
{
if(gshp.getShapes().get(j) instanceof AutoShape)
{
ashp=(AutoShape)gshp.getShapes().get(j);
ashp.serialize(bout);
}
}
}
}
}
Point2D.Float startPt=new Point2D.Float((ashp.getX()) + (ashp.getWidth() / 2), (ashp.getY()) + (ashp.getHeight()));
ByteArrayInputStream bin=new ByteArrayInputStream(bout.toByteArray());
Shape Nodeshp=gshp.getShapes().add(bin);
Nodeshp.setY(ashp.getY()+ ashp.getWidth()+50);
Point2D.Float endPt = new Point2D.Float(Nodeshp.getX()+(Nodeshp.getWidth())/2,Nodeshp.getY());
gshp.getShapes().addConnector( ConnectorType.STRAIGHT , startPt, endPt);
pres.write("d:\\ppt\\smartart\\Organization+Chart+JAVA.ppt");
} catch (PptException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}