Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

{CONNECT C#] sweep profile along Bspline or curve has error

$
0
0

Hi, I want to create a Bspline curve element, but when I try to create the bspline, the MS will have the error and close automatic.

This is my code:

            BCOM.Application msApp = Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp;

            List<BCOM.Point3d> pts = new List<BCOM.Point3d>();
            pts.Add(createPoint(-20, 0, 20));
            pts.Add(createPoint(-20, 0, -20));
            pts.Add(createPoint(20, 0, -20));
            pts.Add(createPoint(20, 0, 20));
            pts.Add(createPoint(-20, 0, 20));

            BCOM.ShapeElement shape = msApp.CreateShapeElement1(null, pts.ToArray(), BCOM.MsdFillMode.Filled);
            BCOM.Point3d sPt = createPoint(0, 0, 0);
            BCOM.Point3d ePt = createPoint(200, 200, 200);
            BCOM.CurveElement lin = Model_Draw.Instance.createClothoidLine(createPoint(0, 0, 0), 300, 0, 90, true);
            BCOM.BsplineCurveElement cur = lin.AsBsplineCurveElement();
            msApp.ActiveModelReference.AddElement(cur);
            BCOM.SmartSolidElement SmartELE = Model_Draw.Instance.msApp.SmartSolid.SweepProfileAlongPath(shape, cur);
            msApp.ActiveModelReference.AddElement(SmartELE);

PS. If I sweep profile along curve element, the MS has error,too.


Viewing all articles
Browse latest Browse all 7260


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>