.NET

.NET

Reply
Contributor
19 Posts
0 Kudos
Registered: ‎06-21-2012
Post 1 of 2
Accepted Solution

extruding an open polyline to create a surface

610 Views, 1 Replies
05-16-2013 04:04 PM

How do I go about extruding an open polyline to create a surface ? I am able to extrude a solid 3d from a closed polyline ( by creating a region first) but I cant find a way to do the same for surfaces.The autodesk.autocad.databaseservices.Surface class does not have an extrude method unlike the its solid3d equivalent. I am using autocad 2012 .

Thank you

If anyone is interested ,this is how is implemented it..

 

 

 Polyline pPoly = pEntity as Polyline;
Autodesk.AutoCAD.DatabaseServices.ExtrudedSurface extrSurf = new Autodesk.AutoCAD.DatabaseServices.ExtrudedSurface();
Autodesk.AutoCAD.DatabaseServices.Face face = new Autodesk.AutoCAD.DatabaseServices.Face(
pPoly.StartPoint,pPoly.EndPoint,pPoly.EndPoint + new Vector3d(0, 0, 1000), pPoly.StartPoint + new Vector3d(0, 0, 1000), true, true, true, true);
Autodesk.AutoCAD.DatabaseServices.Surface sweepEnt = new Autodesk.AutoCAD.DatabaseServices.Surface();
sweepEnt.SetDatabaseDefaults();
try
{
sweepEnt
= Autodesk.AutoCAD.DatabaseServices.Surface.CreateFrom(face);
}
catch (Autodesk.AutoCAD.Runtime.Exception e)
{
}
SweepOptions sweepOpts = new SweepOptions();
try
{
extrSurf.CreateExtrudedSurface(sweepEnt, (pPoly.EndPoint - pPoly.StartPoint).GetPerpendicularVector(), sweepOpts);
}
catch
{
ed.WriteMessage(
"\nFailed with CreateExtrudedSurface."
);
}

 

Contributor
19 Posts
0 Kudos
Registered: ‎06-21-2012
Post 2 of 2

Re: extruding an open polyline to create a surface

05-20-2013 02:35 PM in reply to: insiaiftiqhar

If anyone is interested ,this is how is implemented it..

 

 

 Polyline pPoly = pEntity as Polyline;

Autodesk.AutoCAD.DatabaseServices.ExtrudedSurface extrSurf = new Autodesk.AutoCAD.DatabaseServices.ExtrudedSurface();

       Autodesk.AutoCAD.DatabaseServices.Face face = new Autodesk.AutoCAD.DatabaseServices.Face(
                            pPoly.StartPoint,pPoly.EndPoint,pPoly.EndPoint + new Vector3d(0, 0, 1000), pPoly.StartPoint + new Vector3d(0, 0, 1000),  true, true, true, true);

Autodesk.AutoCAD.DatabaseServices.Surface sweepEnt = new Autodesk.AutoCAD.DatabaseServices.Surface();
                        sweepEnt.SetDatabaseDefaults();

                        try
                        {
                            sweepEnt

                                = Autodesk.AutoCAD.DatabaseServices.Surface.CreateFrom(face);
                        }
                        catch (Autodesk.AutoCAD.Runtime.Exception e)
                        {
                        }                    
                                
                        
                        SweepOptions sweepOpts = new SweepOptions();                        
                     
                        try
                        {                          
                            extrSurf.CreateExtrudedSurface(sweepEnt, (pPoly.EndPoint - pPoly.StartPoint).GetPerpendicularVector(), sweepOpts);
                        }
                        catch
                        {

                              ed.WriteMessage(

                              "\nFailed with CreateExtrudedSurface."

                            );

                        }

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!