How create on the modelspace NurbSurface?

How create on the modelspace NurbSurface?

galaxyblazer
Enthusiast Enthusiast
451 Views
1 Reply
Message 1 of 2

How create on the modelspace NurbSurface?

galaxyblazer
Enthusiast
Enthusiast

Hi,

 

I have a problem with creating nurbsurface on the model space .
I try create not a rational surfaces.

Autodesk.AutoCAD.DatabaseServices.NurbSurface nurb =
                    new Autodesk.AutoCAD.DatabaseServices.NurbSurface(UDegree, VDegree, NurbRational, ControlPoints.Count, ControlPoints[0].Count, Points, NurbWeights, NurbKnots(UKnots), NurbKnots(VKnots));

return nurb;

Then i try set it on the model space. (I have a method which return object of entity GetMyEntity(object entity) )

 Autodesk.AutoCAD.DatabaseServices.Entity ent = GetMyEntity(key) as Autodesk.AutoCAD.DatabaseServices.Entity;
            if (ent != null)
            {
                using (Transaction transaction = tm.StartTransaction())
                {
                    BlockTable bt = (BlockTable)tm.GetObject(db.BlockTableId, OpenMode.ForRead, false);
                    BlockTableRecord btr = (BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
                    btr.AppendEntity(ent);
                    tm.AddNewlyCreatedDBObject(ent, true);
                    transaction.Commit();

                }
            }

This code works when i try set to modelspace simple nurbsurface. But if i try set to modelspace surface with 40 - 70 controls points , this surface is not created ... or maybi it invisible  .... Can somebody help me with this?

0 Likes
452 Views
1 Reply
Reply (1)
Message 2 of 2

SEANT61
Advisor
Advisor

Your post does not give much with which to work.  Just showing the Constructor doesn't help if the data in the parameters have not been filled correctly.

Right up front, this looks a little suspicious:

Autodesk.AutoCAD.DatabaseServices.NurbSurface nurb =
                    new Autodesk.AutoCAD.DatabaseServices.NurbSurface(UDeg​ree, VDegree, NurbRational, ControlPoints.Count, ControlPoints[0].Count, Points, NurbWeights, NurbKnots(UKnots), NurbKnots(VKnots));

return nurb;


************************************************************
May your cursor always snap to the location intended.
0 Likes